This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 2e2c1bb720a89425cd235c345c5b601682ad345a
Author: Claus Ibsen <[email protected]>
AuthorDate: Thu Oct 7 14:35:47 2021 +0200

    CAMEL-16861: Cleanup and update EIP docs
---
 .../modules/eips/pages/message-translator.adoc     | 88 +++++++++++++---------
 1 file changed, 53 insertions(+), 35 deletions(-)

diff --git 
a/core/camel-core-engine/src/main/docs/modules/eips/pages/message-translator.adoc
 
b/core/camel-core-engine/src/main/docs/modules/eips/pages/message-translator.adoc
index bc6b08a..aaf8ad2 100644
--- 
a/core/camel-core-engine/src/main/docs/modules/eips/pages/message-translator.adoc
+++ 
b/core/camel-core-engine/src/main/docs/modules/eips/pages/message-translator.adoc
@@ -12,70 +12,88 @@ The Message Translator can be done in different ways in 
Camel:
 * Using xref:transform-eip.adoc[Transform] in the DSL
 * Calling a xref:latest@manual:ROOT:processor.adoc[Processor] or 
xref:latest@manual:ROOT:bean-integration.adoc[bean]
   to perform the transformation
+* Using template-based xref:components::index.adoc[Components], with the 
template being the source for how the message is translated
 * Messages can also be transformed using 
xref:latest@manual:ROOT:data-format.adoc[Data Format]
   to marshal and unmarshal messages in different encodings.
 
 == Example
 
-You can transform a message using Camel's
-xref:latest@manual:ROOT:bean-integration.adoc[Bean Integration] to call any 
method on a
-bean in your xref:latest@manual:ROOT:registry.adoc[Registry] such as your
-xref:latest@manual:ROOT:spring.adoc[Spring] XML configuration file as follows
+Each of above approaches is documented in the following examples
+
+=== Message Translator with Bean
+
+You can transform a message using Camels
+xref:latest@manual:ROOT:bean-integration.adoc[Bean Integration] to call any 
method on a bean
+that performs the message translation:
 
 [source,java]
 ----
-from("activemq:SomeQueue")
-  .bean("myTransformerBean", "myMethodName")
-  .to("mqseries:AnotherQueue");
+from("activemq:cheese")
+  .bean("myTransformerBean", "doTransform")
+  .to("activemq:wine");
 ----
 
-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 xref:latest@manual:ROOT:bean-integration.adoc[Bean 
Integration] will try
-to deduce the method to invoke from the message exchange.
+And in XML:
+
+[source,xml]
+----
+<route>
+    <from uri="activemq:cheese"/>
+    <bean ref="myTransformerBean" method="doTransform"/>
+    <to uri="activemq:wine"/>
+</route>
+----
 
-or you can add your own explicit 
xref:latest@manual:ROOT:processor.adoc[Processor] to do
-the transformation
+=== Message Translator with Processor
 
-or you can use the DSL to explicitly configure the transformation
+You can also use a xref:latest@manual:ROOT:processor.adoc[Processor] to do
+the transformation:
 
-You can also use xref:latest@manual:ROOT:spring-xml-extensions.adoc[Spring XML 
Extensions]
-to do a transformation. Basically any 
xref:latest@manual:ROOT:expression.adoc[Expression]
-language can be substituted inside the transform element as shown below
+[source,java]
+----
+from("activemq:cheese")
+  .process(new MyTransformerProcessor())
+  .to("activemq:wine");
+----
 
-Or you can use the xref:latest@manual:ROOT:bean-integration.adoc[Bean 
Integration] to
-invoke a bean
+And in XML:
 
 [source,xml]
 ----
 <route>
-  <from uri="activemq:SomeQueue"/>
-  <bean ref="myTransformerBean" method="myMethodName"/>
-  <to uri="mqseries:AnotherQueue"/>
+    <from uri="activemq:cheese"/>
+    <process ref="myTransformerProcessor"/>
+    <to uri="activemq:wine"/>
 </route>
 ----
 
-You can also consume a message
-from one destination, transform it with something like
+=== Message Translator using Templating Components
+
+You can also consume a message from one destination, transform it with 
something like
 xref:components::velocity-component.adoc[Velocity] or 
xref:components::xquery-component.adoc[XQuery] and then send
-it on to another destination. For example using InOnly (one way
-messaging)
+it on to another destination.
 
 [source,java]
 ----
-from("activemq:My.Queue")
+from("activemq:cheese")
     .to("velocity:com/acme/MyResponse.vm")
-    .to("activemq:Another.Queue");
+    .to("activemq:wine");
 ----
 
-If you want to use InOut (request-reply) semantics to process requests
-on the *My.Queue* queue on xref:components::activemq-component.adoc[ActiveMQ] 
with a template
-generated response, then sending responses back to the JMSReplyTo
-Destination you could use this.
+And in XML:
 
-[source,java]
+[source,xml]
 ----
-from("activemq:My.Queue")
-    .to("velocity:com/acme/MyResponse.vm");
+<route>
+    <from uri="activemq:cheese"/>
+    <to uri="velocity:com/acme/MyResponse.vm"/>
+    <to uri="activemq:wine"/>
+</route>
 ----
 
+=== Message Translator using Data Format
+
+TODO:
+
+
+

Reply via email to