A common concern with data integration is the ability to allow for the different data formats that the communicating applications are using. Therefore, the Message Translator pattern will translate the data formats from one system to another to facilitate communication.
This problem arises because each application can have a different interpretation of a Customer entity or record since each application arose independently and use their own data models. For example, financial applications are focused on metric valuations for transactions and invoicing data while CRM applications are interested in dimensional content like contact information and customer hierarchies.
Using XML DSL:
<route> <from uri="activemq:order"/> <transform> <simple>Order attached${body}</simple> </transform> <to uri="activemq:invoice"/> </route>
Using Bean in XML DSL:
We can also transform a message using a Bean and call any method on it to perform message translation:
<route> <from uri="activemq:order"/> <bean ref="buildInvoiceBean" method="createInvoice"/> <to uri="activemq:invoice"/> </route>
Using Processor in XML DSL:
We can incorporate the use of a processor to perform more involved consumption, processing, and translation tasks on a message:
<route> <from uri="activemq:order"/> <process ref="orderInvoiceProcessor"/> <to uri="activemq:invoice"/> </route>