This is an automated email from the ASF dual-hosted git repository. acosentino pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel.git
commit 0f1c778e022af55ed4ed1633689caa00ff181bef Author: Andrea Cosentino <anco...@gmail.com> AuthorDate: Wed May 29 11:04:43 2019 +0200 CAMEL-10324 - Docs --- .../camel-cbor/src/main/docs/cbor-dataformat.adoc | 81 ++++++++++ .../camel-cbor/src/main/docs/jolt-component.adoc | 165 --------------------- docs/components/modules/ROOT/nav.adoc | 2 +- .../modules/ROOT/pages/cbor-dataformat.adoc | 81 ++++++++++ 4 files changed, 163 insertions(+), 166 deletions(-) diff --git a/components/camel-cbor/src/main/docs/cbor-dataformat.adoc b/components/camel-cbor/src/main/docs/cbor-dataformat.adoc new file mode 100644 index 0000000..aa2a57a --- /dev/null +++ b/components/camel-cbor/src/main/docs/cbor-dataformat.adoc @@ -0,0 +1,81 @@ +[[cbor-dataformat]] +== CBOR DataFormat + +*Available as of Camel version 3.0* + +CBOR is a Data Format which uses the +http://wiki.fasterxml.com/JacksonHome/[Jackson library] with the +https://github.com/FasterXML/jackson-dataformats-binary/tree/master/cbor[CBOR extension] +to unmarshal a CBOR payload into Java objects or to marshal Java objects +into a CBOR payload. + +[source,java] +------------------------------- +from("activemq:My.Queue"). + unmarshal().cbor(). + to("mqseries:Another.Queue"); +------------------------------- + +### CBOR Options + +// dataformat options: START +The CBOR dataformat supports 7 options, which are listed below. + + + +[width="100%",cols="2s,1m,1m,6",options="header"] +|=== +| Name | Default | Java Type | Description +| objectMapper | | String | Lookup and use the existing CBOR ObjectMapper with the given id when using Jackson. +| useDefaultObjectMapper | true | Boolean | Whether to lookup and use default Jackson CBOR ObjectMapper from the registry. +| unmarshalTypeName | | String | Class name of the java type to use when unarmshalling +| collectionTypeName | | String | Refers to a custom collection type to lookup in the registry to use. This option should rarely be used, but allows to use different collection types than java.util.Collection based as default. +| useList | false | Boolean | To unarmshal to a List of Map or a List of Pojo. +| allowUnmarshallType | false | Boolean | 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. +| contentTypeHeader | false | Boolean | Whether the data format should set the Content-Type header with the type from the data format if the data format is capable of doing so. For example application/xml for data formats marshalling to XML, or application/json for data formats marshalling to JSon etc. +|=== +// dataformat options: END +// spring-boot-auto-configure options: START +=== Spring Boot Auto-Configuration + +When using Spring Boot make sure to use the following Maven dependency to have support for auto configuration: + +[source,xml] +---- +<dependency> + <groupId>org.apache.camel</groupId> + <artifactId>camel-cbor-starter</artifactId> + <version>x.x.x</version> + <!-- use the same version as your Camel core version --> +</dependency> +---- + + +The component supports 8 options, which are listed below. + + + +[width="100%",cols="2,5,^1,2",options="header"] +|=== +| Name | Description | Default | Type +| *camel.dataformat.cbor.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.cbor.collection-type-name* | Refers to a custom collection type to lookup in the registry to use. This option should rarely be used, but allows to use different collection types than java.util.Collection based as default. | | String +| *camel.dataformat.cbor.content-type-header* | Whether the data format should set the Content-Type header with the type from the data format if the data format is capable of doing so. For example application/xml for data formats marshalling to XML, or application/json for data formats marshalling to JSon etc. | false | Boolean +| *camel.dataformat.cbor.enabled* | Whether to enable auto configuration of the cbor data format. This is enabled by default. | | Boolean +| *camel.dataformat.cbor.object-mapper* | Lookup and use the existing CBOR ObjectMapper with the given id when using Jackson. | | String +| *camel.dataformat.cbor.unmarshal-type-name* | Class name of the java type to use when unarmshalling | | String +| *camel.dataformat.cbor.use-default-object-mapper* | Whether to lookup and use default Jackson CBOR ObjectMapper from the registry. | true | Boolean +| *camel.dataformat.cbor.use-list* | To unarmshal to a List of Map or a List of Pojo. | false | Boolean +|=== +// spring-boot-auto-configure options: END + +### Dependencies + +[source,java] +------------------------------------- +<dependency> + <groupId>org.apache.camel</groupId> + <artifactId>camel-cbor</artifactId> + <version>x.x.x</version> +</dependency> +------------------------------------- diff --git a/components/camel-cbor/src/main/docs/jolt-component.adoc b/components/camel-cbor/src/main/docs/jolt-component.adoc deleted file mode 100644 index bb517e8..0000000 --- a/components/camel-cbor/src/main/docs/jolt-component.adoc +++ /dev/null @@ -1,165 +0,0 @@ -[[jolt-component]] -== JOLT Component - -*Available as of Camel version 2.16* - -The *jolt:* component allows you to process a JSON messages using an -https://github.com/bazaarvoice/jolt[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: - -[source,xml] ------------------------------------------------------------- -<dependency> - <groupId>org.apache.camel</groupId> - <artifactId>camel-jolt</artifactId> - <version>x.x.x</version> - <!-- use the same version as your Camel core version --> -</dependency> ------------------------------------------------------------- - - - -### URI format - -[source,java] ------------------------ -jolt:specName[?options] ------------------------ - -Where *specName* is the classpath-local URI of the specification to -invoke; or the complete URL of the remote specification -(eg: file://folder/myfile.vm[file://folder/myfile.json]). - -You can append query options to the URI in the following -format, `?option=value&option=value&...` - -### Options - - - - -// component options: START -The JOLT component supports 3 options, which are listed below. - - - -[width="100%",cols="2,5,^1,2",options="header"] -|=== -| Name | Description | Default | Type -| *transform* (advanced) | Explicitly sets the Transform to use. If not set a Transform specified by the transformDsl will be created | | Transform -| *resolveProperty Placeholders* (advanced) | Whether the component should resolve property placeholders on itself when starting. Only properties which are of String type can use property placeholders. | true | boolean -| *basicPropertyBinding* (advanced) | Whether the component should use basic property binding (Camel 2.x) or the newer property binding with additional capabilities | false | boolean -|=== -// component options: END - - - - - - -// endpoint options: START -The JOLT endpoint is configured using URI syntax: - ----- -jolt:resourceUri ----- - -with the following path and query parameters: - -==== Path Parameters (1 parameters): - - -[width="100%",cols="2,5,^1,2",options="header"] -|=== -| Name | Description | Default | Type -| *resourceUri* | *Required* Path to the resource. You can prefix with: classpath, file, http, ref, or bean. classpath, file and http loads the resource using these protocols (classpath is default). ref will lookup the resource in the registry. bean will call a method on a bean to be used as the resource. For bean you can specify the method name after dot, eg bean:myBean.myMethod. | | String -|=== - - -==== Query Parameters (6 parameters): - - -[width="100%",cols="2,5,^1,2",options="header"] -|=== -| Name | Description | Default | Type -| *contentCache* (producer) | Sets whether to use resource content cache or not | false | boolean -| *inputType* (producer) | Specifies if the input is hydrated JSON or a JSON String. | Hydrated | JoltInputOutputType -| *outputType* (producer) | Specifies if the output should be hydrated JSON or a JSON String. | Hydrated | JoltInputOutputType -| *transformDsl* (producer) | Specifies the Transform DSL of the endpoint resource. If none is specified Chainr will be used. | Chainr | JoltTransformType -| *basicPropertyBinding* (advanced) | Whether the endpoint should use basic property binding (Camel 2.x) or the newer property binding with additional capabilities | false | boolean -| *synchronous* (advanced) | Sets whether synchronous processing should be strictly used, or Camel is allowed to use asynchronous processing (if supported). | false | boolean -|=== -// endpoint options: END -// spring-boot-auto-configure options: START -=== Spring Boot Auto-Configuration - -When using Spring Boot make sure to use the following Maven dependency to have support for auto configuration: - -[source,xml] ----- -<dependency> - <groupId>org.apache.camel</groupId> - <artifactId>camel-jolt-starter</artifactId> - <version>x.x.x</version> - <!-- use the same version as your Camel core version --> -</dependency> ----- - - -The component supports 4 options, which are listed below. - - - -[width="100%",cols="2,5,^1,2",options="header"] -|=== -| Name | Description | Default | Type -| *camel.component.jolt.basic-property-binding* | Whether the component should use basic property binding (Camel 2.x) or the newer property binding with additional capabilities | false | Boolean -| *camel.component.jolt.enabled* | Enable jolt component | true | Boolean -| *camel.component.jolt.resolve-property-placeholders* | Whether the component should resolve property placeholders on itself when starting. Only properties which are of String type can use property placeholders. | true | Boolean -| *camel.component.jolt.transform* | Explicitly sets the Transform to use. If not set a Transform specified by the transformDsl will be created. The option is a com.bazaarvoice.jolt.Transform type. | | String -|=== -// spring-boot-auto-configure options: END - - - - -### Samples - -For example you could use something like - -[source,java] --------------------------------------- -from("activemq:My.Queue"). - to("jolt:com/acme/MyResponse.json"); --------------------------------------- - -And a file based resource: - -[source,java] ---------------------------------------------------------------- -from("activemq:My.Queue"). - to("jolt:file://myfolder/MyResponse.json?contentCache=true"). - to("activemq:Another.Queue"); ---------------------------------------------------------------- - -You can also specify what specification the component should use -dynamically via a header, so for example: - -[source,java] ---------------------------------------------------------------------- -from("direct:in"). - setHeader("CamelJoltResourceUri").constant("path/to/my/spec.json"). - to("jolt:dummy"); ---------------------------------------------------------------------- - - - -### See Also - -* Configuring Camel -* Component -* Endpoint -* Getting Started diff --git a/docs/components/modules/ROOT/nav.adoc b/docs/components/modules/ROOT/nav.adoc index 2069e15..b95c954 100644 --- a/docs/components/modules/ROOT/nav.adoc +++ b/docs/components/modules/ROOT/nav.adoc @@ -58,7 +58,7 @@ * xref:caffeine-cache-component.adoc[Caffeine Cache Component] * xref:caffeine-loadcache-component.adoc[Caffeine LoadCache Component] * xref:cql-component.adoc[Cassandra CQL Component] -* xref:jolt-component.adoc[JOLT Component] +* xref:cbor-dataformat.adoc[CBOR DataFormat] * xref:cdi.adoc[Camel CDI] * xref:chatscript-component.adoc[ChatScript Component] * xref:chunk-component.adoc[Chunk Component] diff --git a/docs/components/modules/ROOT/pages/cbor-dataformat.adoc b/docs/components/modules/ROOT/pages/cbor-dataformat.adoc new file mode 100644 index 0000000..aa2a57a --- /dev/null +++ b/docs/components/modules/ROOT/pages/cbor-dataformat.adoc @@ -0,0 +1,81 @@ +[[cbor-dataformat]] +== CBOR DataFormat + +*Available as of Camel version 3.0* + +CBOR is a Data Format which uses the +http://wiki.fasterxml.com/JacksonHome/[Jackson library] with the +https://github.com/FasterXML/jackson-dataformats-binary/tree/master/cbor[CBOR extension] +to unmarshal a CBOR payload into Java objects or to marshal Java objects +into a CBOR payload. + +[source,java] +------------------------------- +from("activemq:My.Queue"). + unmarshal().cbor(). + to("mqseries:Another.Queue"); +------------------------------- + +### CBOR Options + +// dataformat options: START +The CBOR dataformat supports 7 options, which are listed below. + + + +[width="100%",cols="2s,1m,1m,6",options="header"] +|=== +| Name | Default | Java Type | Description +| objectMapper | | String | Lookup and use the existing CBOR ObjectMapper with the given id when using Jackson. +| useDefaultObjectMapper | true | Boolean | Whether to lookup and use default Jackson CBOR ObjectMapper from the registry. +| unmarshalTypeName | | String | Class name of the java type to use when unarmshalling +| collectionTypeName | | String | Refers to a custom collection type to lookup in the registry to use. This option should rarely be used, but allows to use different collection types than java.util.Collection based as default. +| useList | false | Boolean | To unarmshal to a List of Map or a List of Pojo. +| allowUnmarshallType | false | Boolean | 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. +| contentTypeHeader | false | Boolean | Whether the data format should set the Content-Type header with the type from the data format if the data format is capable of doing so. For example application/xml for data formats marshalling to XML, or application/json for data formats marshalling to JSon etc. +|=== +// dataformat options: END +// spring-boot-auto-configure options: START +=== Spring Boot Auto-Configuration + +When using Spring Boot make sure to use the following Maven dependency to have support for auto configuration: + +[source,xml] +---- +<dependency> + <groupId>org.apache.camel</groupId> + <artifactId>camel-cbor-starter</artifactId> + <version>x.x.x</version> + <!-- use the same version as your Camel core version --> +</dependency> +---- + + +The component supports 8 options, which are listed below. + + + +[width="100%",cols="2,5,^1,2",options="header"] +|=== +| Name | Description | Default | Type +| *camel.dataformat.cbor.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.cbor.collection-type-name* | Refers to a custom collection type to lookup in the registry to use. This option should rarely be used, but allows to use different collection types than java.util.Collection based as default. | | String +| *camel.dataformat.cbor.content-type-header* | Whether the data format should set the Content-Type header with the type from the data format if the data format is capable of doing so. For example application/xml for data formats marshalling to XML, or application/json for data formats marshalling to JSon etc. | false | Boolean +| *camel.dataformat.cbor.enabled* | Whether to enable auto configuration of the cbor data format. This is enabled by default. | | Boolean +| *camel.dataformat.cbor.object-mapper* | Lookup and use the existing CBOR ObjectMapper with the given id when using Jackson. | | String +| *camel.dataformat.cbor.unmarshal-type-name* | Class name of the java type to use when unarmshalling | | String +| *camel.dataformat.cbor.use-default-object-mapper* | Whether to lookup and use default Jackson CBOR ObjectMapper from the registry. | true | Boolean +| *camel.dataformat.cbor.use-list* | To unarmshal to a List of Map or a List of Pojo. | false | Boolean +|=== +// spring-boot-auto-configure options: END + +### Dependencies + +[source,java] +------------------------------------- +<dependency> + <groupId>org.apache.camel</groupId> + <artifactId>camel-cbor</artifactId> + <version>x.x.x</version> +</dependency> +-------------------------------------