Given that WSO2 ESB is an extensible solution, that does not mean that it is lacking OOTB features. In fact it provides the most complete feature set provided by any open source integration solution in the market. But as you know, it is not a silver bullet (In fact we can't make silver bullets). Therefore, you may encounter some scenarios where you need to write a custom transport implementation to connect with one of your systems.
I will be taking ISO8583 messaging standard to write this custom transport implementation. It is used heavily in the financial transactions domain for credit card transaction processing. One of the reasons to select this as my custom transport implementation is that there is an already written code for this transport by Manoj Fernando in this blog post. Since my focus of this blog post is to describe about writing a custom transport implementation, I think I am not re-writing what Manoj has written.
Enough talking. Let's do some real work. WSO2 ESB mediation engine can be depicted in the following diagram.
- As depicted in the above diagram, requests/responses coming from clients/servers (Inbound) will be hitting the ESB through the transport layer. It will select the proper transport receiver implementation by looking at the request URI (eg: HTTP, TCP, JMS, etc.)
- Transport will hand over this message to the appropriate message builder according to the content-type (if specified) specified in the message.
- Then the message will be handed over to the Axis engine(In Flow) where it does the QOS related operations.
- After that, message will be handed over to the mediation engine for executing the mediation logic configured with mediators.
- Then again, message will be going through the Axis engine (Out Flow) for any QOS related operations.
- Message formatter will be selected according to the content-type provided in the message.
- Then the message will be passed back to the relevant transport sender implementation to send the message from ESB to client/server (Outbound)
Alright.. Alright .. Now we know what happens to a message coming towards the WSO2 ESB and what happens when message is going out of the same. I have highlighted 4 terms in the previous section. Those 4 terms are
- Transport Receiver
- Message Builder
- Message Formatter
- Transport Sender
These would be the classes we need to implement for our custom transport implementation. WSO2 ESB has provided the interfaces for these implementations such that you need to focus only on the business logic rather than knowing the internals of WSO2 ESB. We will be using following interfaces to write our custom implementation.
- org.apache.axis2.transport.base.AbstractTransportListener
- org.apache.axis2.builder.Builder
- org.apache.axis2.transport.MessageFormatter
- org.apache.axis2.transport.base.AbstractTransportSender
Now we have the ground covered for our custom transport implementation. Let's do some coding. I will be transferring this discussion to my next blog post since this is getting too long here.
http://soatutorials.blogspot.com/2015/06/extending-wso2-esb-with-custom_21.html
http://soatutorials.blogspot.com/2015/06/extending-wso2-esb-with-custom_21.html
thanks for sharing information
ReplyDeletecustomized billing solutions
thanks and great work
ReplyDeletecustomized billing solutions
Bardzo fajny artykuł , przydatny gdy ktoś oferuje transport Wrocław czy przeprowadzki Wrocław
ReplyDelete