이 콘텐츠는 선택한 언어로 제공되지 않습니다.

Chapter 86. Jolt


JOLT Component

Available as of Camel 2.16
The Jolt component allows you to process a JSON messages using an JOLT specification. This can be ideal when doing JSON to JSON transformation.
Maven users will need to add the following dependency to their pom.xml for this component:
<dependency>
    <groupId>org.apache.camel</groupId>
    <artifactId>camel-jolt</artifactId>
    <version>2.17.0.redhat-630xxx</version>
    <!-- use the same version as your Camel core version -->
</dependency>
Copy to Clipboard Toggle word wrap

URI format

jolt:specName[?options]
Copy to Clipboard Toggle word wrap
Where specName is the classpath-local URI of the specification to invoke; or the complete URL of the remote specification (eg: file://folder/myfile.json).
You can append query options to the URI in the following format, ?option=value&option=value&...

Options

Expand
Option
Default
Description
allowContextMapAll (producer)
false
Sets whether the context map should allow access to all details. By default only the message body and headers can be accessed. This option can be enabled for full access to the current Exchange and CamelContext. Doing so imposes a potential security risk as this opens access to the full power of CamelContext API.
allowTemplateFromHeader (producer)
false
Whether to allow to use resource template from header or not (default false). Enabling this option has security ramifications. For example, if the header contains untrusted or user derived content, this can ultimately impact on the confidentility and integrity of your end application, so use this option with caution.
contentCache
true
Cache for the resource content when it is loaded. Note : as of Camel 2.9 cached resource content can be cleared via JMX using the endpoint's clearContentCache operation.
outputType
Hydrated
Sets the output of the transformation to Hydrated as List or Maps, or JsonString as a String object containing the JSON.
inputType
Hydrated
Sets the input of the transformation to Hydrated as List or Maps, or JsonString as a String object containing the JSON.
transformDsl
Chainr
The transform DSL to use for loading the provided specification. Available values Chainr, Shiftr, Defaultr, Removr and Sortr.

Dynamic specification

Camel provides a header by which you can define a different resource location for a specification. If this header is set then Camel uses this over the endpoint configured resource. This allows you to provide a dynamic specification at runtime.
Expand
Header
Type
Description
CamelJoltResourceUri
String
A URI for the specification resource to use instead of the endpoint configured.

Samples

For example you could use something like
from("activemq:My.Queue").
  to("jolt:com/acme/MyResponse.json");
Copy to Clipboard Toggle word wrap
And a file based resource:
from("activemq:My.Queue").
  to("jolt:file://myfolder/MyResponse.json?contentCache=true").
  to("activemq:Another.Queue");
Copy to Clipboard Toggle word wrap
You can also specify what specification the component should use dynamically via a header, so for example:
from("direct:in").
  setHeader("CamelJoltResourceUri").constant("path/to/my/spec.json").
  to("jolt:dummy?allowTemplateFromHeader=true");
Copy to Clipboard Toggle word wrap
Warning
Enabling the allowTemplateFromHeader option has security ramifications. For example, if the header contains untrusted or user derived content, this can ultimately impact on the confidentility and integrity of your end application, so use this option with caution.
맨 위로 이동
Red Hat logoGithubredditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다. 최신 업데이트를 확인하세요.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

Theme

© 2025 Red Hat