180.4. 샘플
예를 들면 다음과 같은 것을 사용할 수 있습니다.
from("activemq:My.Queue"). to("jolt:com/acme/MyResponse.json");
from("activemq:My.Queue").
to("jolt:com/acme/MyResponse.json");
파일 기반 리소스:
from("activemq:My.Queue"). to("jolt:file://myfolder/MyResponse.json?contentCache=true"). to("activemq:Another.Queue");
from("activemq:My.Queue").
to("jolt:file://myfolder/MyResponse.json?contentCache=true").
to("activemq:Another.Queue");
다음과 같이 헤더를 통해 구성 요소가 동적으로 사용해야 하는 사양을 지정할 수도 있습니다.
from("direct:in"). setHeader("CamelJoltResourceUri").constant("path/to/my/spec.json"). to("jolt:dummy?allowTemplateFromHeader=true");
from("direct:in").
setHeader("CamelJoltResourceUri").constant("path/to/my/spec.json").
to("jolt:dummy?allowTemplateFromHeader=true");
주의
allowTemplateFromHeader
옵션을 활성화하면 보안 RAM이 있습니다. 예를 들어 헤더에 신뢰할 수 없거나 사용자가 파생된 콘텐츠가 포함된 경우 결국 최종 애플리케이션의 신뢰도와 무결성에 영향을 줄 수 있으므로 이 옵션을 신중하게 사용합니다.