This documentation is for WSO2 Enterprise Service Bus version 5.0.0. For the latest ESB, view the latest WSO2 Enterprise Integrator documentation.

All docs This doc
||
Skip to end of metadata
Go to start of metadata

RabbitMQ transport allows you to send or receive AMQP messages by calling an AMQP broker (RabbitMQ) directly. In order to improve the performance of the RabbitMQ transport you can do following.

Set queue and exchange declaration parameters to false

Setting rabbitmq.queue.autodeclare and rabbitmq.exchange.autodeclare parameters in the publish url to false can improve the RabbitMQ transport performance.

When these parameters are set to false RabbitMQ does not try to create queues or exchanges if queues or exchanges are not present. However, you should set these parameters if and only if queues and exchanges are declared prior on the broker.

Increase the connection pool size

You can increase the connection pool size to improve the performance of the RabbitMQ sender and listener. The default connection pool size is 20. To change this, specify a required value for the following parameter in the RabbitMQ transport sender and listener configurations in the <ESB_HOME>/repository/conf/axis2/axis2.xml file.

<parameter name="rabbitmq.connection.pool.size" locked="false">25</parameter>
 Sample Receiver Configuration
<transportReceiver name="rabbitmq" class="org.apache.axis2.transport.rabbitmq.RabbitMQListener">
   <parameter name="AMQPConnectionFactory" locked="false">
      <parameter name="rabbitmq.server.host.name" locked="false">localhost</parameter>
      <parameter name="rabbitmq.server.port" locked="false">5672</parameter>
      <parameter name="rabbitmq.server.user.name" locked="false"></parameter>
      <parameter name="rabbitmq.server.password" locked="false"></parameter>
      <parameter name="rabbitmq.connection.retry.interval" locked="false">10000</parameter>
      <parameter name="rabbitmq.connection.retry.count" locked="false">5</parameter>
      <parameter name="rabbitmq.connection.pool.size" locked="false">25</parameter>
    </parameter>
</transportReceiver>
 Sample Sender Configuration
<transportSender name="rabbitmq" class="org.apache.axis2.transport.rabbitmq.RabbitMQSender">
   <parameter name="RabbitMQConnectionFactory" locked="false">
       <parameter name="rabbitmq.server.host.name" locked="false">localhost</parameter>
       <parameter name="rabbitmq.server.port" locked="false">5672</parameter>
       <parameter name="rabbitmq.server.user.name" locked="false"></parameter>
       <parameter name="rabbitmq.server.password" locked="false"></parameter>
       <parameter name="rabbitmq.connection.retry.interval" locked="false">10000</parameter>
       <parameter name="rabbitmq.connection.retry.count" locked="false">5</parameter>
       <parameter name="rabbitmq.connection.pool.size" locked="false">10</parameter>
   </parameter>
</transportSender>

Reuse the connection factory in the publisher

In the publisher url set the connection factory name instead of the connection parameters as specified below in the rabbitmq.connection.factory parameter . This reuses the connection factories and thereby improves performance.

<address uri="rabbitmq://?rabbitmq.connection.factory=RabbitMQConnectionFactory&amp;rabbitmq.queue.name=queue1&amp;rabbitmq.queue.routing.key=queue1&amp;rabbitmq.replyto.name=replyqueue&amp;rabbitmq.exchange.name=ex1&amp;rabbitmq.queue.autodeclare=false&amp;rabbitmq.exchange.autodeclare=false&amp;rabbitmq.replyto.name=response_queue"/>
  • No labels