33.5. 샘플
샘플 예제는 아래와 같습니다.
from("activemq:My.Queue"). to("jslt:com/acme/MyResponse.json");
from("activemq:My.Queue").
to("jslt:com/acme/MyResponse.json");
파일 기반 리소스입니다.
from("activemq:My.Queue"). to("jslt:file://myfolder/MyResponse.json?contentCache=true"). to("activemq:Another.Queue");
from("activemq:My.Queue").
to("jslt:file://myfolder/MyResponse.json?contentCache=true").
to("activemq:Another.Queue");
다음과 같이 구성 요소가 헤더를 통해 동적으로 사용해야 하는 JSLT 표현식을 지정할 수도 있습니다.
from("direct:in"). setHeader("CamelJsltResourceUri").constant("path/to/my/spec.json"). to("jslt:dummy?allowTemplateFromHeader=true");
from("direct:in").
setHeader("CamelJsltResourceUri").constant("path/to/my/spec.json").
to("jslt:dummy?allowTemplateFromHeader=true");
또는 헤더를 통해 전체 jslt 표현식을 보내십시오: (쿼리에 적합한)
from("direct:in"). setHeader("CamelJsltString").constant(".published"). to("jslt:dummy?allowTemplateFromHeader=true");
from("direct:in").
setHeader("CamelJsltString").constant(".published").
to("jslt:dummy?allowTemplateFromHeader=true");
다음과 같이 교환 속성을 jslt 표현식에 전달할 수 있습니다.
from("direct:in"). to("jslt:com/acme/MyResponse.json?allowContextMapAll=true");
from("direct:in").
to("jslt:com/acme/MyResponse.json?allowContextMapAll=true");