JSON Jackson

Marshal POJOs to JSON and back using Jackson.

What’s inside

Please refer to the above links for usage and configuration details.

Maven coordinates

<dependency>
    <groupId>org.apache.camel.springboot</groupId>
    <artifactId>camel-jackson3-starter</artifactId>
</dependency>

Spring Boot Auto-Configuration

The starter supports 23 options, which are listed below.

Name Description Default Type

camel.dataformat.jackson.allow-jms-type

Used for JMS users to allow the JMSType header from the JMS spec to specify a FQN classname to use to unmarshal to.

false

Boolean

camel.dataformat.jackson.allow-unmarshall-type

If enabled then Jackson is allowed to attempt to use the CamelJacksonUnmarshalType header during the unmarshalling. This should only be enabled when desired to be used.

false

Boolean

camel.dataformat.jackson.auto-discover-object-mapper

If set to true then Jackson will look for an objectMapper to use from the registry.

false

Boolean

camel.dataformat.jackson.auto-discover-schema-resolver

When not disabled, the SchemaResolver will be looked up into the registry.

true

Boolean

camel.dataformat.jackson.collection-type

Refers to a custom collection type to lookup in the registry to use. This option should rarely be used, but allows using different collection types than java.util.Collection based as default.

String

camel.dataformat.jackson.combine-unicode-surrogates

Force generator that outputs JSON content to combine surrogate pairs (if any) into 4-byte characters. This should be preferred when using 4-byte characters such as Japanese.

false

Boolean

camel.dataformat.jackson.content-type-header

Whether the data format should set the Content-Type header with the type from the data format. For example application/xml for data formats marshalling to XML, or application/json for data formats marshalling to JSON

true

Boolean

camel.dataformat.jackson.disable-features

Set of features to disable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. Multiple features can be separated by comma.

String

camel.dataformat.jackson.enable-features

Set of features to enable on the Jackson com.fasterxml.jackson.databind.ObjectMapper. Multiple features can be separated by comma.

String

camel.dataformat.jackson.enabled

Whether to enable auto configuration of the jackson data format. This is enabled by default.

Boolean

camel.dataformat.jackson.include

If you want to marshal a POJO to JSON, and the POJO has some fields with null values. And you want to skip these null values, you can set this option to NON_NULL.

String

camel.dataformat.jackson.json-view

When marshalling a POJO to JSON you might want to exclude certain fields from the JSON output. With Jackson you can use JSON views to accomplish this. This option is to refer to the class which has JsonView annotations.

String

camel.dataformat.jackson.max-string-length

Sets the maximum string length (in chars or bytes, depending on input context). The default is 20,000,000.

Integer

camel.dataformat.jackson.module-class-names

To use custom Jackson modules com.fasterxml.jackson.databind.Module specified as a String with FQN class names. Multiple classes can be separated by comma.

String

camel.dataformat.jackson.module-refs

To use custom Jackson modules referred from the Camel registry. Multiple modules can be separated by comma.

String

camel.dataformat.jackson.naming-strategy

If set then Jackson will use the the defined Property Naming Strategy.Possible values are: LOWER_CAMEL_CASE, LOWER_DOT_CASE, LOWER_CASE, KEBAB_CASE, SNAKE_CASE and UPPER_CAMEL_CASE

String

camel.dataformat.jackson.object-mapper

Lookup and use the existing ObjectMapper with the given id when using Jackson.

String

camel.dataformat.jackson.pretty-print

To enable pretty printing output nicely formatted. Is by default false.

false

Boolean

camel.dataformat.jackson.schema-resolver

Optional schema resolver used to lookup schemas for the data in transit. The option is a org.apache.camel.component.jackson.SchemaResolver type.

String

camel.dataformat.jackson.timezone

If set then Jackson will use the Timezone when marshalling/unmarshalling.

String

camel.dataformat.jackson.unmarshal-type

Class name of the java type to use when unmarshalling.

String

camel.dataformat.jackson.use-default-object-mapper

Whether to lookup and use default Jackson ObjectMapper from the registry.

true

Boolean

camel.dataformat.jackson.use-list

To unmarshal to a List of Map or a List of Pojo.

false

Boolean