How to use different Axis2 configurations per Message Processor in WSO2 EI.

Isuru Liyanage
CodeBlog
Published in
2 min readSep 20, 2023

When we use Message processors in WSO2 EI, there are times where we need to have unique axis2 configurations.

Example :

The Message Processor endpoint uses Blocking calls to invoke the endpoint. So if we need to have timeout for this endpoint we need to add below property to transportsender in the axis2_blocking_client.xml file

<parameter name="SO_TIMEOUT">10000</parameter>

This will apply the timeout globally for all the Blocking calls in WSO2 EI server.
What should we do if we only want to have the time timeout for this single message processor endpoint?

In this blog I’m going to show you how to use axis2 configuration per message processor that you have created. From this approach you can have unique configuration per Message Processor endpoints.

Steps :

  1. Get a copy of “axis2_blocking_client.xml” file which is located in [EI_HOME]/conf/axis2 directory
  2. Paste the copy of “axis2_blocking_client.xml” file in the same location and rename it with a preferred name. I’ll be renaming it as “axis2_blocking_client_MP.xml”
  3. Now add the below property in the Message Processor synapse configuration. This Message Processor will refer to the axis2_blocking_client_MP.xml file now
  <parameter name="axis2.config">conf/axis2/axis2_blocking_client_MP.xml</parameter>

4. Restart the EI server if its running

Below is the full synapse configuration of the Message Processor

<?xml version="1.0" encoding="UTF-8"?>
<messageProcessor xmlns="http://ws.apache.org/ns/synapse"
class="org.apache.synapse.message.processor.impl.forwarder.ScheduledMessageForwardingProcessor"
name="sales-delivery-processor"
targetEndpoint="DeliveryEndpoint"
messageStore="sales-delivery-store">
<parameter name="client.retry.interval">1000</parameter>
<parameter name="throttle">false</parameter>
<parameter name="max.delivery.attempts">4</parameter>
<parameter name="member.count">1</parameter>
<parameter name="store.connection.retry.interval">1000</parameter>
<parameter name="max.store.connection.attempts">-1</parameter>
<parameter name="max.delivery.drop">Disabled</parameter>
<parameter name="interval">1000</parameter>
<parameter name="message.processor.failMessagesStore">sales-store</parameter>
<parameter name="is.active">true</parameter>
<parameter name="axis2.config">conf/axis2/axis2_blocking_client_MP.xml</parameter>
<parameter name="target.endpoint">DeliveryEndpoint</parameter>
</messageProcessor>

--

--