Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin

...

Camel supports the Message Translator from the EIP patterns by using an artibrary arbitrary Processor in the routing logic or , by using a bean in the Bean Integration to perform the transformation, or by using transform() in the DSL. You can also use a Data Format to marshal and unmarshal messages in different encodings.

Using the Fluent Builders

...

You can transform a message using Camel's Bean Integration to call any method on a bean in your Registry such as your Spring XML configuration file as follows

...

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 Bean Integration will try to deduce the method to invoke from the message exchange.

or you can add your own explicit Processor to do the transformation

...

or you can add your own Processor

...

use the DSL to explicitly configure the transformation

...

Use Spring XML

You can also use Spring XML Extensions to do a transformation. Basically any Expression language can be substituted inside the transform element as shown below

...

Or you could can use Camel's the Bean Integration by calling to invoke a named bean from your Registry such as your Spring XML configuration file as follows

...

...

Where the "myTransformerBean" would be defined in a Spring XML file or defined in JNDI etc.

...

You can also You can use Templating to consume a message from one destination, transform it with something like Velocity or XQuery and then send it on to another destination. For example using InOnly (one way messaging)

...

...

If you want to use InOut (request-reply) semantics to process requests on the My.Queue queue on ActiveMQ with a template generated response, then sending responses back to the JMSReplyTo Destination you could use this.

...

For further examples of this pattern in use you could look at one of the JUnit tests

...