You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2019/05/30 08:17:45 UTC
[camel] 01/02: Camel-CBOR: More docs
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 11f2b29a953bd7d6f26e91f8bcde62e9d78d5d91
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Thu May 30 10:08:19 2019 +0200
Camel-CBOR: More docs
---
.../camel-cbor/src/main/docs/cbor-dataformat.adoc | 26 ++++++++++++++++++++++
1 file changed, 26 insertions(+)
diff --git a/components/camel-cbor/src/main/docs/cbor-dataformat.adoc b/components/camel-cbor/src/main/docs/cbor-dataformat.adoc
index 60a03d6..bf7e263 100644
--- a/components/camel-cbor/src/main/docs/cbor-dataformat.adoc
+++ b/components/camel-cbor/src/main/docs/cbor-dataformat.adoc
@@ -69,6 +69,32 @@ The component supports 8 options, which are listed below.
|===
// spring-boot-auto-configure options: END
+#### Using CBOR in Spring DSL
+
+When using Data Format in Spring DSL you need to
+declare the data formats first. This is done in the *DataFormats* XML
+tag.
+
+[source,xml]
+-----------------------------------------------------------------------------------------------------------------------------
+ <dataFormats>
+ <!-- here we define a CBOR data format with the id test and that it should use the TestPojo as the class type when
+ doing unmarshal. -->
+ <cbor id="test" unmarshalTypeName="org.apache.camel.component.cbor.TestPojo"/>
+ </dataFormats>
+-----------------------------------------------------------------------------------------------------------------------------
+
+And then you can refer to this id in the route:
+
+[source,xml]
+-------------------------------------
+ <route>
+ <from uri="direct:back"/>
+ <unmarshal><custom ref="test"/></unmarshal>
+ <to uri="mock:reverse"/>
+ </route>
+-------------------------------------
+
### Dependencies
[source,java]