RabbitMQ
Last updated
Was this helpful?
Last updated
Was this helpful?
Strictly speaking, AMQP (and 0.9.1 version used) is a protocol, not a full-fledged driver, so you can use any servers that support this protocol (on your own, only rabbitmq was tested), such as:
,
.
However, it is recommended to use RabbitMQ as the main implementation, and reliable performance with other implementations is not guaranteed.
To install and configure the RabbitMQ, use the corresponding .
After that, you should configure the connection to the server in the amqp
section. This configuration section contains exactly one addr
key with a . The TLS
configuration sits in the amqp.tls
section and consists of the following options:
key
: path to a key file.
cert
: path to a certificate file.
root_ca
: CA certificate path, used with the client_auth_type
.
client_auth_type
: also known as mTLS
. Possible values are: request_client_cert
, require_any_client_cert
, verify_client_cert_if_given
, require_and_verify_client_cert
, no_client_certs
.
You should also configure rabbitMQ
with TLS
support: .
Upon establishing a connection to the server, you can create a new queue that utilizes this connection and encompasses the queue settings, including those specific to AMQP.
Here is a detailed description of each of the amqp-specific options:
priority
- job priority. A lower value corresponds to a higher priority. For instance, consider two pipelines: pipe1
with a priority of 1
and pipe10
with a priority of 10
. Workers will only take jobs from pipe10
if all the jobs from pipe1
have been processed.
queue
- required, AMQP internal (inside the driver) queue name.
exchange
- required, rabbitMQ exchange name.
exchange_type
- rabbitMQ exchange type. May be one of direct
, topics
,headers
or fanout
.
routing_key
- queue's routing key. Required to push the Job
.
exclusive
- applied to the queue, exclusive queues cannot be redeclared. If set to true, and you attempt to declare the same pipeline twice, it will result in an error.
multiple_ack
- this delivery, along with all prior unacknowledged deliveries on the same channel, will be acknowledged. This feature is beneficial for batch processing of deliveries and is applicable only for Ack
, not for Nack
.
requeue_on_fail
- requeue on Nack (by RabbitMQ).
queue_headers
- used to pass arguments to the Queue
create method, such as x-queue-mode: lazy
durable
- create a durable queue.
Default: false
delete_queue_on_stop
- delete the queue when the pipeline is stopped.
Default: false
redial_timeout
- Redial timeout (in seconds). How long to try to reconnect to the AMQP server.
Default: false
Default: false
Default: false
consumer_id
- string that is unique and scoped for all consumers on this channel.
prefetch
- rabbitMQ QoS prefetch. See also . Note that if you use a large number of workers and a small prefetch
number, some of the workers may not be loaded with messages (jobs) due to the blocking nature of the prefetch. This would result in poor RoadRunner performance and waste of resources.
See also documentation section.
exchange_durable
- Durable exchange ().
exchange_auto_delete
- Auto-delete (exchange is deleted when last queue is unbound from it): .
queue_auto_delete
- Auto-delete (queue that has had at least one consumer is deleted when last consumer unsubscribes): .