RabbitMQ Trigger
The RabbitMQ Trigger provides similar functionality as Queue and Service Bus Triggers but with RabbitMQ queue in particular. This Trigger has been available since Frends version 5.5.
Queue(required)Name of the queue to listen to
Connection string(required)AMQP 0-9-1 URI, e.g.
amqp://guest:guest@localhost:5672/Max concurrent messagesLimit on how many messages will be processed at a time. Essentially will limit the number of Processes running at the same time on a single Agent. An empty value, or a value of 0 is treated as infinite.
Retry message processing if exception is thrown
If set, and the first Process execution fails in an exception, the Process is executed a second timeReply
If set, the result of a successful Process execution will be sent to a response queue. The response queue is set to theReplyToproperty of the request. If theReplyToproperty is not set, the response queue is set toDefault reply queueReply errorsIf set, the result of a failed Process execution will be sent to a response queue
Default reply queueThe queue to which responses will be sent if the
ReplyToproperty is not set
Reply messages
Sometimes you need to get a reply back to the sender of the request, e.g. when the caller needs to wait for the triggered Process to finish, or needs the results. In this case, you can turn on replies on the RabbitMQ Trigger. This will then return the result of the Process in a message that is put to the given reply queue.
The request-reply Process usually goes as follows:
The caller decides on a queue for receiving the reply, and starts listening to it. A message is sent to the queue listened by the Trigger, with the
ReplyToproperty set to the reply queue. ThecorrelationIdproperty may also be set to help correlate requests and responses.The Trigger will receive the request and start a new Process Instance, passing the message body and properties as Trigger properties to the Process.
The Process finishes. In two cases, the flow ends here:
If the Process succeeded, and
Replyis not selected.If the Process failed, and
Reply Errorsis not selected.
Otherwise, a response is created, which can happen in one of three ways:
If the Process succeeded, and the Process result is a RabbitMQ message (i.e, an object containing a
BodyandBasicProperties), the message is used as a response. This allows developers to customize the response to their exact needs.If the Process succeeded, and the Process result is not a RabbitMQ message, the response is set to the Process result.
If the Process failed, the response is set to the message of the exception.
In the last two cases, the properties are set by the Agent. The
CorrelationIdproperty is set to theCorrelationIdvalue from the request, and some other common properties set to sensible values.The response is then sent to the queue given in the
ReplyToproperty, or if the request did not define one, in theDefault reply queue.The caller will receive the reply message and process it as desired.
Referencing Trigger parameter values
The Trigger will pass the message content serialized as a UTF-8 string to the Process. It can be accessed via the #trigger.data.body reference.
Message properties can be accessed under #trigger.data.BasicProperties, e.g. #trigger.data.BasicProperties.CorrelationId. Some routing details are also available, e.g. #trigger.data.RoutingKey. More information on properties and routing details is available in RabbitMQ's Publisher documentation.
The next article is Introduction to Conditional Trigger


