Tuesday, May 23, 2017

WSO2 ESB message flow

This post explains the message flow of the synapse which is the main building block of WSO2 ESB.

Synapse receives the message from the axis2 transport layer. Inside this transport layer, message will be built based on the content type of the message and then passed over to the Synapse. 

Following is the Inflow of the message from the entry point to synapse,

Inside the Axis2FlexibleMEPClient.send() method, a callback is registered in axis2 transport layer and message is dispatched out of the synapse. Then the axis2 transport layer format this message based on the content type and send it to the backend.

When the response is coming from a backend service, transport layer identifies this and synapse response path is invoked.

Following is the synapse response path,

This completes the message flow for the following proxy service configuration.

Monday, May 22, 2017

Processing Binary Data from TCP transport in WSO2 ESB

This post describes how to process binary data over TCP transport in WSO2 ESB.

  • First we need to enable binary transport. Add following entries in ESB_HOME/repository/conf/axis2/axis2.xml. 

  • Now you need to add the message formatters and message builders to be used. Since we are using binary data, add following entry inside messageFormatters element. 
          Add following entry inside messageBuilders element. 

  • Now you can add a tcp proxy service to process the message. In that proxy service you need to add the same content type used in messageFormatter and messageBuilder configs. There are several other parameters specific to TCP proxies. Refer [1] for more info on that. Following is a sample proxy service that prints the binary message. 

  • Now you can invoke this proxy service using a sample TCP client. End of message should be marked with a "|" symbol in this particular proxy service.