This documentation is for WSO2 Enterprise Integrator version 6.1.0 . View documentation for the latest release in the 6.x.x family and the latest release in the 7.x.x family.

All docs This doc

Versions Compared

Key

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

...

Table of Contents
maxLevel35

Increase the maximum number of JMS proxies

...

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>

Configuring proxy-level throttling

Info

The following feature is supported in WSO2 EI 6.1.0 as a product update. This update is availble through WSO2 Update Manager from the 17th of September, 2019 onwards.

Throttling can be configured in a proxy service (JMS consumer) to control the number of JMS messages that are processed by the service. To enable throttling, the 'jms.proxy.throttle.enabled' parameter should be added to the proxy service as shown below. By default, throttling is disabled for a JMS consumer.

Code Block
<?xml version="1.0" encoding="UTF-8"?><proxy xmlns="http://ws.apache.org/ns/synapse" name="StockQuoteProxy" startOnLoad="true" statistics="disable" trace="disable" transports="jms">
    <target>
        <inSequence>
            ..........
        </inSequence>
    </target>
    <parameter name="jms.proxy.throttle.enabled">true</parameter>
    .........
    <description/>
</proxy>

When this parameter is enabled, the JMS consumer can consume a maximum of 60 messages during a 60 second (one minute) window at a fixed rate of one message per second. If required, you can configure the maximum number of messages that can be consumed (throttle limit) and the rate at which messages are consumed (throttle mode) during the 60 second window.

Excerpt Include
JMS Transport
JMS Transport
nopaneltrue

In the following example, a maximum of 30 messages can be consumed during 60 seconds at a default fixed rate of one message every two seconds.

Code Block
<?xml version="1.0" encoding="UTF-8"?><proxy xmlns="http://ws.apache.org/ns/synapse" name="StockQuoteProxy" startOnLoad="true" statistics="disable" trace="disable" transports="jms">
    <target>
        <inSequence>
            ..........
        </inSequence>
    </target>
    <parameter name="jms.proxy.throttle.enabled">true</parameter>
    <parameter name="jms.proxy.throttle.limitPerMinute">30</parameter>
    .........
    <description/>
</proxy>

In the following example, the throttle mode is set to 'batch'. Therefore, messages received will be consumed as quickly as possible until the throttle limit is reached or until the window expires.

Code Block
<?xml version="1.0" encoding="UTF-8"?><proxy xmlns="http://ws.apache.org/ns/synapse" name="StockQuoteProxy" startOnLoad="true" statistics="disable" trace="disable" transports="jms">
    <target>
        <inSequence>
            ..........
        </inSequence>
    </target>
    <parameter name="jms.proxy.throttle.enabled">true</parameter>
    <parameter name="jms.proxy.throttle.mode">batch</parameter>
    <parameter name="jms.proxy.throttle.limitPerMinute">30</parameter>
    .........
    <description/>
</proxy>

Configuring JMS Sender

Enabling caching

...