AMQP is a wire-level messaging protocol that describes the format of the data that is sent across the network. If a system or application can read and write AMQP, it can exchange messages with any other system or application that understands AMQP, regardless of the implementation language.
...
- Open
<EI_HOME>/conf/axis2/axis2.xml
for editing. In the transport listeners section, add the following RabbitMQ transport listener, replacing the values with your host, port, username, and password to connect to the AMQP broker.
Code Block language html/xml <transportReceiver name="rabbitmq" class="org.apache.axis2.transport.rabbitmq.RabbitMQListener"> <parameter name="AMQPConnectionFactory" locked="false"> <parameter name="rabbitmq.server.host.name" locked="false">192.168.0.3</parameter> <parameter name="rabbitmq.server.port" locked="false">5672</parameter> <parameter name="rabbitmq.server.user.name" locked="false">user</parameter> <parameter name="rabbitmq.server.password" locked="false">abc123</parameter> </parameter> </transportReceiver>
As an optional step, you can create multiple connection factories if you want this listener to connect to multiple brokers.
In the transport senders section, add the following RabbitMQ transport sender, which will be used for sending AMQP messages to a queue:
Code Block language html/xml <transportSender name="rabbitmq" class="org.apache.axis2.transport.rabbitmq.RabbitMQSender"/>
- Download the "amqp-client-5.7.0.jar" and copy it into
<EI_HOME>/lib
folder - Start WSO2 EI.
RabbitMQ AMQP transport parameters
...
Parameter | Description | Required | |||||
---|---|---|---|---|---|---|---|
rabbitmq.connection.factory | The name of the connection factory. | Yes | |||||
rabbitmq.exchange.name | Name of the RabbitMQ exchange to which the queue is bound. Use this parameter instead of rabbitmq.queue.routing.key , if you need to use the default exchange and publish to a queue. | No | |||||
rabbitmq.queue.name | The queue name to send or consume messages. If you do not specify this parameter, you need to specify the rabbitmq.queue.routing.key parameter. | Yes | |||||
rabbitmq.queue.auto.ack | Defines how the message processor sends the acknowledgement when consuming messages recived from the RabbitMQ message store. If you set this to true, the message processor automatically sends the acknowledgement to the messages store as soon as it receives messages from it. This is called an auto acknowledgement. If you set it to false, the message processor waits until it receives the response from the backend to send the acknowledgement to the mssage store. This is called a client acknowledgement. | No | |||||
rabbitmq.consumer.tag | The client generated consumer tag to establish context. | No | |||||
rabbitmq.channel.consumer.qos | The consumer qos value. You need to specify this parameter only if the rabbitmq.queue.auto.ack parameter is set to false . | No | |||||
rabbitmq.queue.durable | Whether the queue should remain declared even if the broker restarts. | No | |||||
rabbitmq.queue.exclusive | Whether the queue should be exclusive or should be consumable by other connections. | No | |||||
rabbitmq.queue.auto.delete | Whether to keep the queue even if it is not being consumed anymore. | No | |||||
rabbitmq.queue.routing.key | The routing key of the queue. | No | |||||
rabbitmq.queue.autodeclare | Whether to create queues if they are not present. However, you should set this parameter only if queues are not declared prior on the broker. Setting this parameter in the publish URL to false improves RabbitMQ transport performance. | No | |||||
rabbitmq.exchange.autodeclare | Whether to create exchanges if they are not present. However, you should set this parameter only if exchanges are not declared prior on the broker. Setting this parameter in the publish URL to false improves RabbitMQ transport performance. | No | |||||
rabbitmq.exchange.type | The type of the exchange. | No | |||||
rabbitmq.exchange.durable | Whether the exchange should remain declared even if the broker restarts. | No | |||||
rabbitmq.exchange.auto.delete | Whether to keep the exchange even if it is not bound to any queue anymore. | No | |||||
rabbitmq.message.content.type | The content type of the consumer.
| No. The default value is text/xml . |
...