Table of Contents
List of Tables
List of Examples
RabbitMQ Consumer (http://www.rabbitmq.com/) is an open source messaging server. It's purpose is to manage received messages in queues, taking advantage of the flexible AMQP protocol.
Using this module you can subscribe consumers to a RabbitMQ broker in order to receive AMQP messages for specified queues. The messages will be delivered by triggering events through the OpenSIPS Event Interface.
Specify the configuration for a RabbitMQ connection. It contains a set of parameters used to customize the connection to the server as well as the consumer subscription. The format of the parameter is param1=value1; param2=value2;. The uri, queue and event parameters are mandatory.
This parameter can be set multiple times, for each RabbitMQ connection.
The following parameters can be used:
uri - Mandatory parameter - a full amqp URI as described here. Missing fields in the URI will receive default values, such as: user: guest, password: guest, host: localhost, vhost: /, port: 5672. SSL connections are currently not available: amqps URIs will be declined.
queue - Mandatory parameter - the name of the RabbitMQ queue to subscribe a consumer to. This parameter is mandatory.
event - Mandatory parameter - the name of the OpenSIPS event that will be triggered for each AMQP message received.
ack - flag that indicates to the broker that messages will be acknowledged upon receival. If you do not set this flag, the server will not expect ACKs and OpenSIPS will not send them.
exclusive - flag that indicates to the broker that exclusive consumer access is requested, meaning only this consumer can access the queue.
frame_max - the maximum size of an AMQP frame. Default size is 131072.
heartbeat - interval in seconds used to send heartbeat messages. Default is disabled.
Example 1.1. Set
... # connection to a RabbitMQ server on localhost, default port # with a 5 seconds interval for heartbeat messages modparam("rabbitmq_consumer", "connection_id", "uri = amqp://127.0.0.1; queue = myqueue1; event = E_Q1_MSG; heartbeat = 5;") ... # consumer that acknowledges messages modparam("rabbitmq_consumer", "connection_id", "uri = amqp://127.0.0.1; queue = myqueue2; event = E_Q2_MSG; ack;") ...
The maximally allowed duration (in milliseconds) for the establishment of a TCP connection with a RabbitMQ server.
Default value is “500” (milliseconds).
Example 1.2. Setting the
... modparam("rabbitmq_consumer", "connect_timeout", 1000) ...
The interval (in milliseconds) after which OpenSIPS will try to re-establish a failed AMQP connection to a RabbitMQ server.
Default value is “5000” (milliseconds).
Example 1.3. Setting the
... modparam("rabbitmq_consumer", "retry_timeout", 10000) ...
An event with a custom name, as set in the event field of the connection_id parameter, will be raised for each AMQP message received.
body - the AMQP message body.
Table 2.1. Top contributors by DevScore(1), authored commits(2) and lines added/removed(3)
(1) DevScore = author_commits + author_lines_added / (project_lines_added / project_commits) + author_lines_deleted / (project_lines_deleted / project_commits)
(2) including any documentation-related commits, excluding merge commits. Regarding imported patches/code, we do our best to count the work on behalf of the proper owner, as per the "fix_authors" and "mod_renames" arrays in opensips/doc/build-contrib.sh. If you identify any patches/commits which do not get properly attributed to you, please submit a pull request which extends "fix_authors" and/or "mod_renames".
(3) ignoring whitespace edits, renamed files and auto-generated files
Table 2.2. Most recently active contributors(1) to this module
(1) including any documentation-related commits, excluding merge commits
Last edited by: Vlad Patrascu (@rvlad-patrascu).
Copyright © 2019 www.opensips-solutions.com