camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From acosent...@apache.org
Subject [2/4] camel git commit: Added Message Translator docs to Gitbook
Date Tue, 25 Oct 2016 08:02:55 GMT
Added Message Translator docs to Gitbook


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/08371c3a
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/08371c3a
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/08371c3a

Branch: refs/heads/master
Commit: 08371c3ab0e2b67aa9b46cddf5155aec4a0ce5f7
Parents: d111a44
Author: Andrea Cosentino <ancosen@gmail.com>
Authored: Tue Oct 25 09:43:27 2016 +0200
Committer: Andrea Cosentino <ancosen@gmail.com>
Committed: Tue Oct 25 09:43:27 2016 +0200

----------------------------------------------------------------------
 .../src/main/docs/message-translator.adoc       | 96 ++++++++++++++++++++
 docs/user-manual/en/SUMMARY.md                  |  1 +
 2 files changed, 97 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/08371c3a/camel-core/src/main/docs/message-translator.adoc
----------------------------------------------------------------------
diff --git a/camel-core/src/main/docs/message-translator.adoc b/camel-core/src/main/docs/message-translator.adoc
new file mode 100644
index 0000000..8d4d573
--- /dev/null
+++ b/camel-core/src/main/docs/message-translator.adoc
@@ -0,0 +1,96 @@
+[[MessageTranslator-MessageTranslator]]
+Message Translator
+^^^^^^^^^^^^^^^^^^
+
+Camel supports the
+http://www.enterpriseintegrationpatterns.com/MessageTranslator.html[Message
+Translator] from the link:enterprise-integration-patterns.html[EIP
+patterns] by using an arbitrary link:processor.html[Processor] in the
+routing logic, by using a link:bean-integration.html[bean] to perform
+the transformation, or by using transform() in the DSL. You can also use
+a link:data-format.html[Data Format] to marshal and unmarshal messages
+in different encodings.
+
+image:http://www.enterpriseintegrationpatterns.com/img/MessageTranslator.gif[image]
+
+*Using the link:fluent-builders.html[Fluent Builders]*
+
+You can transform a message using Camel's
+link:bean-integration.html[Bean Integration] to call any method on a
+bean in your link:registry.html[Registry] such as your
+link:spring.html[Spring] XML configuration file as follows
+
+[source,java]
+-----------------------------------------------
+from("activemq:SomeQueue").
+  beanRef("myTransformerBean", "myMethodName").
+  to("mqseries:AnotherQueue");
+-----------------------------------------------
+
+Where the "myTransformerBean" would be defined in a Spring XML file or
+defined in JNDI etc. You can omit the method name parameter from
+beanRef() and the link:bean-integration.html[Bean Integration] will try
+to deduce the method to invoke from the message exchange.
+
+or you can add your own explicit link:processor.html[Processor] to do
+the transformation
+
+or you can use the DSL to explicitly configure the transformation
+
+*Use Spring XML*
+
+You can also use link:spring-xml-extensions.html[Spring XML Extensions]
+to do a transformation. Basically any link:expression.html[Expression]
+language can be substituted inside the transform element as shown below
+
+Or you can use the link:bean-integration.html[Bean Integration] to
+invoke a bean
+
+[source,java]
+-----------------------------------------------
+<route>
+  <from uri="activemq:Input"/>
+  <bean ref="myBeanName" method="doTransform"/>
+  <to uri="activemq:Output"/>
+</route>
+-----------------------------------------------
+
+You can also use link:templating.html[Templating] to consume a message
+from one destination, transform it with something like
+link:velocity.html[Velocity] or link:xquery.html[XQuery] and then send
+it on to another destination. For example using InOnly (one way
+messaging)
+
+[source,java]
+----------------------------------------
+from("activemq:My.Queue").
+  to("velocity:com/acme/MyResponse.vm").
+  to("activemq:Another.Queue");
+----------------------------------------
+
+If you want to use InOut (request-reply) semantics to process requests
+on the *My.Queue* queue on link:activemq.html[ActiveMQ] with a template
+generated response, then sending responses back to the JMSReplyTo
+Destination you could use this.
+
+[source,java]
+----------------------------------------
+from("activemq:My.Queue").
+  to("velocity:com/acme/MyResponse.vm");
+----------------------------------------
+
+[[MessageTranslator-UsingThisPattern]]
+Using This Pattern
+++++++++++++++++++
+
+If you would like to use this EIP Pattern then please read the
+link:getting-started.html[Getting Started], you may also find the
+link:architecture.html[Architecture] useful particularly the description
+of link:endpoint.html[Endpoint] and link:uris.html[URIs]. Then you could
+try out some of the link:examples.html[Examples] first before trying
+this pattern out.
+
+* link:content-enricher.html[Content Enricher]
+* link:using-getin-or-getout-methods-on-exchange.html[Using getIn or
+getOut methods on Exchange]
+

http://git-wip-us.apache.org/repos/asf/camel/blob/08371c3a/docs/user-manual/en/SUMMARY.md
----------------------------------------------------------------------
diff --git a/docs/user-manual/en/SUMMARY.md b/docs/user-manual/en/SUMMARY.md
index 91bc9a5..ed60548 100644
--- a/docs/user-manual/en/SUMMARY.md
+++ b/docs/user-manual/en/SUMMARY.md
@@ -79,6 +79,7 @@
     * [Message](message.adoc)
     * [Message Channel](message-channel.adoc)
     * [Message Router](message-router.adoc)
+    * [Message Translator](message-translator.adoc)
     * [Pipes and Filter](pipes-and-filters.adoc)
     * [Request Reply](request-reply.adoc)
     * [Return Address](return-address.adoc)


Mime
View raw message