The purpose of this example is to demonstrate on how the Message Bus EIP pattern is supported through the WSO2 ESB. The purpose of the Message Bus is to allow separate applications to work together in decoupled manner. Which in return will make the maintenance, testing smoother since editing or removal of an application will not affect the functionality of any other application.
Compatibility of WSO2 ESB
The architecture of the WSO2 ESB is discussed clearly in ESB Architecture. Which illustrates how each application logic is layered. Also notice that each of the application logic has being separated as a mediator where the message processing is done in a decoupled manner. The mediation process is best explained in Message Mediation. The below illustrates a sample ESB configuration.
<definitions xmlns="http://ws.apache.org/ns/synapse"> <!-- filtering of messages with XPath and regex matches --> <filter source="get-property('To')" regex=".*/StockQuote.*"> <send> <endpoint> <address uri="http://localhost:9000/services/SimpleStockQuoteService"/> </endpoint> </send> <drop/> </filter> <send/> </definitions>
The above configuration will route an incoming message to a back end server if the conditions mentioned in the filer section are met. Notice and see how each application logic has being decoupled. For filtering its one component to send a message to the endpoint its another, where the fact is apparent that in case if the user desires the filtering is unnecessary all he or she should do is remove the filter mediator out of the XML, which in return will not affect the application logic of sending the message to the back end.