This site contains the documentation that is relevant to older WSO2 product versions and offerings.
For the latest WSO2 documentation, visit https://wso2.com/documentation/.

RabbitMQ Message Store

RabbitMQ message store persists messages in a RabbitMQ queue inside a RabbitMQ broker. The RabbitMQ message store can be configured by specifying the class as org.apache.synapse.message.store.impl.rabbitmq.RabbitmqStore and then setting all other required parameters to connect to a RabbitMQ broker.

UI Configuration

Following is the Add RabbitMQ Message Store screen that you will see on the ESB Management Console.

When you add a RabbitMQ message store, it is required to specify values for the following:

  • Name - A unique name for the RabbitMQ message store. 
  • RabbitMQ Server Host Name (store.rabbitmq.host.name) - The address of the RabbitMQ broker.
  • RabbitMQ Server Host Port (store.rabbitmq.host.port) - The port number of the RabbitMQ message broker. 

In addition to specifying the required parameters, you can click  Show Additional Parameters  and set any of the additional parameters as necessary. For descriptions of each of the additional parameters you can set, see Additional RabbitMQ message store parameters.

If you need to ensure guaranteed delivery when you store incoming messages to a RabbitMQ message store, and then deliver them to a particular backend, click Show Guaranteed Delivery Parameters and specify values for the following parameters:

  • Enable Producer Guaranteed Delivery (store.producer.guaranteed.delivery.enable) - Whether it is required to enable guaranteed delivery on the producer side. Set this to True if you need to ensure guaranteed delivery.
  • Failover Message Store (store.failover.message.store.name) - The message store to which the store mediator should send messages when the original message store fails.

For instructions on adding a required type of message store via the ESB Management Console, see Adding a Message Store.

Additional RabbitMQ message store parameters

Parameter Name

Value

Required

RabbitMQ Queue Name (store.rabbitmq.queue.name)The message store queue name.Though this is not a required parameter, we recommend specifying a value for this.
RabbitMQ Exchange Name (store.rabbitmq.exchange.name)The name of the RabbitMQ exchange to which the queue is bound (If the ESB has to declare this exchange it will be declared as a direct exchange).No
Routing key (store.rabbitmq.route.key)The exchange and queue binding value. Messages will be routed using this. No (This is considered only when both the exchange name and type are provided. Else messages will be routed using the default exchange and queue name as the routing key).
User Name (store.rabbitmq.username) The user name to connect to the broker.

No

Password (store.rabbitmq.password) The password to connect to the broker.No
Virtual Host (store.rabbitmq.virtual.host)The virtual host name of the broker.No

Following is a basic sample RabbitMQ message store configuration:

<messageStore class="org.apache.synapse.message.store.impl.rabbitmq.RabbitmqStore"name="RabbitMS">
  <parameter name="store.rabbitmq.host.name">localhost</parameter>
  <parameter name="store.rabbitmq.queue.name">ESBStore</parameter>
  <parameter name="store.rabbitmq.host.port">5672</parameter>
</messageStore> 	

 

Â