In Chapter 7, you have learnt how to code and build custom components to be deployed in the ServiceMix container. There we used an HttpInterceptor
class to intercept the contents of the JBI exchange and print them out on the console. We will enhance the code from that sample to demonstrate how we can integrate XStream with other JBI classes in ServiceMix.
In the SOA scenarios, we use the XML formatted messages to transport payload across nodes. Whether SOAP formatted or not, XML provides a flexible mechanism to transport data, which can be validated if required using the XML schemas. Let us also build our sample around this. Hence, we will assume that we have an external client sending an XML payload to the ESB. Let us see how we can interact with this data inside the bus.
This is diagrammatically represented in the following figure:
The sample use case will consist of the following components:
HTTP Client: The HTTP Client is a...