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 2021/09/14 09:23:03 UTC
[camel] branch main updated: CAMEL-16849 - Add at least one example
for component in docs - Camel-Avro
This is an automated email from the ASF dual-hosted git repository.
acosentino pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/main by this push:
new 03be4a0 CAMEL-16849 - Add at least one example for component in docs - Camel-Avro
03be4a0 is described below
commit 03be4a071423a0a591d3dd6be0d94d5c0c19bef4
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Tue Sep 14 11:20:48 2021 +0200
CAMEL-16849 - Add at least one example for component in docs - Camel-Avro
---
.../camel-avro/src/main/docs/avro-dataformat.adoc | 46 ++++++++++++++--------
1 file changed, 30 insertions(+), 16 deletions(-)
diff --git a/components/camel-avro/src/main/docs/avro-dataformat.adoc b/components/camel-avro/src/main/docs/avro-dataformat.adoc
index 2cf6482..ea12266 100644
--- a/components/camel-avro/src/main/docs/avro-dataformat.adoc
+++ b/components/camel-avro/src/main/docs/avro-dataformat.adoc
@@ -33,11 +33,40 @@ You can easily generate classes from a schema, using maven, ant etc.
More details can be found at the
http://avro.apache.org/docs/current/[Apache Avro documentation].
-== Using the Avro data format
+
+== Avro Dataformat Options
+
+// dataformat options: START
+The Avro dataformat supports 1 options, which are listed below.
+
+
+
+[width="100%",cols="2s,1m,1m,6",options="header"]
+|===
+| Name | Default | Java Type | Description
+| instanceClassName | | String | Class name to use for marshal and unmarshalling
+|===
+// dataformat options: END
+
+== Examples
+
+== Avro Data Format usage
Using the avro data format is as easy as specifying that the class that
you want to marshal or unmarshal in your route.
+[source,java]
+--------------------------------------------------------------------------------
+AvroDataFormat format = new AvroDataFormat(Value.SCHEMA$);
+
+from("direct:in").marshal(format).to("direct:marshal");
+from("direct:back").unmarshal(format).to("direct:unmarshal");
+--------------------------------------------------------------------------------
+
+Where Value is an Avro Maven Plugin Generated class.
+
+or in XML
+
[source,xml]
--------------------------------------------------------------------------------
<camelContext id="camel" xmlns="http://camel.apache.org/schema/spring">
@@ -70,19 +99,4 @@ reference it from your route.
In the same manner you can umarshal using the avro data format.
-
-== Avro Dataformat Options
-
-// dataformat options: START
-The Avro dataformat supports 1 options, which are listed below.
-
-
-
-[width="100%",cols="2s,1m,1m,6",options="header"]
-|===
-| Name | Default | Java Type | Description
-| instanceClassName | | String | Class name to use for marshal and unmarshalling
-|===
-// dataformat options: END
-
include::{page-component-version}@camel-spring-boot::page$avro-starter.adoc[]