2
votes

I have made a simple proxy service which is listening on a queue on Message Broker. I have successfully implemented the JMS Transaction that if service encounters any error the message is successfully rolled-back. By default the number of maximum re deliveries are 10, after that the message is delivered to dead letter channel.

Problem:

I want to be able to change following two configurations:

1) Maximum number of re-deliveries

2) Time Between Each Redelivery Attempt

Where will i do these configurations, in my {ESB_HOME}/repository/conf/axis2/axis2.xml file or in my Message Broker.

Following is my current configurations of axis2.xml

   <!--Uncomment this and configure as appropriate for JMS transport support with WSO2 MB 2.x.x -->
    <transportReceiver name="jms" class="org.apache.axis2.transport.jms.JMSListener">
        <parameter name="myTopicConnectionFactory" locked="false">
           <parameter name="java.naming.factory.initial" locked="false">org.wso2.andes.jndi.PropertiesFileInitialContextFactory</parameter>
            <parameter name="java.naming.provider.url" locked="false">repository/conf/jndi.properties</parameter>
            <parameter name="transport.jms.SessionTransacted">true</parameter>
            <parameter name="transport.jms.SessionAcknowledgement" locked="true">CLIENT_ACKNOWLEDGE</parameter>
           <parameter name="transport.jms.ConnectionFactoryJNDIName" locked="false">TopicConnectionFactory</parameter>
            <parameter name="transport.jms.ConnectionFactoryType" locked="false">topic</parameter>
        </parameter>

        <parameter name="myQueueConnectionFactory" locked="false">
            <parameter name="java.naming.factory.initial" locked="false">org.wso2.andes.jndi.PropertiesFileInitialContextFactory</parameter>
            <parameter name="java.naming.provider.url" locked="false">repository/conf/jndi.properties</parameter>
            <parameter name="transport.jms.SessionTransacted">true</parameter>
            <parameter name="transport.jms.SessionAcknowledgement" locked="true">CLIENT_ACKNOWLEDGE</parameter>
              <parameter name="transport.jms.ConnectionFactoryJNDIName" locked="false">QueueConnectionFactory</parameter>
           <parameter name="transport.jms.ConnectionFactoryType" locked="false">queue</parameter>
        </parameter>

        <parameter name="default" locked="false">
            <parameter name="java.naming.factory.initial" locked="false">org.wso2.andes.jndi.PropertiesFileInitialContextFactory</parameter>
            <parameter name="java.naming.provider.url" locked="false">repository/conf/jndi.properties</parameter>
            <parameter name="transport.jms.SessionTransacted">true</parameter>
            <parameter name="transport.jms.SessionAcknowledgement" locked="true">CLIENT_ACKNOWLEDGE</parameter>
             <parameter name="transport.jms.ConnectionFactoryJNDIName" locked="false">QueueConnectionFactory</parameter>
            <parameter name="transport.jms.ConnectionFactoryType" locked="false">queue</parameter>
        </parameter>
    </transportReceiver>

Note: I am using WSO2 4.8.1 and WSO2 Message Broker 2.2.0.

What i find:

I have found the solution to first value that is Maximum number of re-deliveries, we can configure this value by editing following tag in {$MB_HOME}/repository/conf/advanced/andes-config.xml file.

<maximumNumberOfMessageDeliveryAttempts>10</maximumNumberOfMessageDeliveryAttempts> 

Unable to find: What i am unable to find is a configuration by which i can change the delay Time between each redelivery attempt. Previously i was using ActiveMQ as the message broker in which we can add following paramter to our {$ESB_HOME}/repository/conf/axis2/axis2.xml file.

<parameter name="redeliveryPolicy.redeliveryDelay" locked="true">1200000</parameter>

I want the same thing in WSO2 Message Broker but i am unable to find any configuration. I tried the above mentioned parameter but it won't work for WSO2 MB.

1
You may need to use message store in this case where you can configure those parameters. [1] -wso2.com/library/articles/2011/12/…harsha89
I am using WSO2 Message Broker(2.2.0). My Question is specific to this Message Broker. I know i have to change configurations but i am not finding the place where i can do that change to adjust above mentioned. Or do you mean to say that in addition to this i have to use a separate message store. But that does not make any sense? Please excuse my ignorance.omer khalid

1 Answers

0
votes

As I know it cannot be done like this in case of WSO2 MB. You have to setup a message store and a message processor guarding on that message store. And when you have a message processor it can be configured with interval and max delivery attempts.

(Alternatively, you can setup the maxAckWaitTime, it means it will wait at least 'maxAckWaitTime' seconds between two redelivery attempts)