314.4. Camel Message에 매핑
Spark Request 오브젝트는 getRequest 메서드를 사용하여 raw Spark 요청에 액세스할 수 있는 org.apache.camel.component.sparkrest.SparkMessage 로 Camel Message에 매핑됩니다. 기본적으로 Spark 본문은 Camel 메시지 본문에 매핑되며 모든 HTTP 헤더 / Spark 매개변수는 Camel Message 헤더에 매핑됩니다. Spark splat 구문에 대한 특수 지원이 있으며 이는 키 splat를 사용하여 Camel 메시지 헤더에 매핑됩니다.
예를 들어, 아래 지정된 경로는 컨텍스트 경로에서 Spark splat( 별표 기호)를 사용하며, 헤더로 액세스할 수 있는 간단한 언어를 작성하여 응답 메시지를 구성할 수 있습니다.
from("spark-rest:get:/hello/*/to/*")
.transform().simple("Bye big ${header.splat[1]} from ${header.splat[0]}");