Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

WSO2 ESB's Java Message Service (JMS) transport allows you to easily send and receive messages to queues and topics of any JMS service that implements the JMS specification. The following sections describes how you can tune the JMS transport of WSO2 ESB for better performance.

Table of Contents
maxLevel3

...

Increase the maximum number of JMS proxies

If you create several JMS proxy services in WSO2 ESB, you will see a message similar to the following:

...

  1. Create a file named jms.properties with the following properties:
    • snd_t_core=200

    • snd_t_max=250

  2. Create a directory called conf under your <ESB_HOME> directory and save the file in this directory.

...

Use concurrent consumers

You can increase the JMS listener performance through concurrent consumers.

...

  • Add the following parameters to the JMS listener configuration of the <ESB_HOME>/repository/conf/axis2/axis2.xml file:

    Code Block
    languagexml
    <parameter name="transport.jms.ConcurrentConsumers" locked="false">50</parameter> 
    <parameter name="transport.jms.MaxConcurrentConsumers" locked="false">50</parameter>

...

Enable caching in the JMS listener

Another way of improving the JMS transport performance is to enable caching.

...

  • Add the following parameter to the JMS listener configuration of the <ESB_HOME>/repository/conf/axis2/axis2.xml file:

    Code Block
    languagexml
    <parameter name="transport.jms.CacheLevel">consumer</parameter>

    The possible values for the cache level are none, auto, connection, session and consumer. Out of the possible values, consumer is the highest level that provides maximum performance.

...

Code Block
languagexml
titleSample JMS listener configuration with concurrent consumers and caching
<transportReceiver name="jms" class="org.apache.axis2.transport.jms.JMSListener"> 
....
<parameter name="myQueueConnectionFactory" locked="false"> 
<parameter name="java.naming.factory.initial" locked="false">org.apache.activemq.jndi.ActiveMQInitialContextFactory</parameter> 
<parameter name="java.naming.provider.url" locked="false">tcp://localhost:61616</parameter> 
<parameter name="transport.jms.ConnectionFactoryJNDIName" locked="false">QueueConnectionFactory</parameter> 
<parameter name="transport.jms.ConnectionFactoryType" locked="false">queue</parameter> 
<parameter name="transport.jms.ConcurrentConsumers" locked="false">50</parameter> 
<parameter name="transport.jms.MaxConcurrentConsumers" locked="false">50</parameter> 
<parameter name="transport.jms.CacheLevel">consumer</parameter> 
</parameter>
….
</transportReceiver>

...

Enable caching in the JMS sender

To enable caching in the JMS sender

  • Add the following parameter to the JMS sender configuration of the <ESB_HOME>/repository/conf/axis2/axis2.xml file:

    Code Block
    languagexml
    <parameter name="transport.jms.CacheLevel">producer</parameter>

    The possible values for the cache level are noneautoconnectionsession and producer. Out of the possible values, producer is the highest level that provides maximum performance.

...

Use ClientApiNonBlocking when sending messages via JMS

By default, Axis2 spawns a new thread to handle each outgoing message. To change this behavior, you need to remove the ClientApiNonBlocking property from the message.

...