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.
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
Trueif 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
|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 (||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 (||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 (||The user name to connect to the broker.|
|Password (||The password to connect to the broker.||No|
|Virtual Host (||The virtual host name of the broker.||No|
Following is a basic sample RabbitMQ message store configuration: