RabbitMQ Trigger
Alternative to Service Bus and AMQP queues.
In order to launch a Process through RabbitMQ messaging queues, RabbitMQ Trigger can be used.
You can learn more about Triggers in general here.
What is RabbitMQ Trigger?
RabbitMQ Trigger is like AMQP Trigger, and listens for new messages in RabbitMQ message queues and activates Processes accordingly. Suitable for event-driven architectures where asynchronous communication is key.
Usage
To use a Trigger in your Process, add it to your Process canvas, and connect it to the beginning of your Process using a Sequence flow. If you are using multiple Triggers in your Process, all Triggers must connect to the same shape, which is also the first non-Trigger shape in your Process.
Once added to your Process, you can change the Trigger's type to match your requirement and give it a unique name. By default, the Trigger's type will provide a corresponding name for the Trigger. You can then configure the parameters for the chosen Trigger type.
For RabbitMQ Trigger, you should set up a messaging queue beforehand, and then connect the Trigger to it through its connection string as well as specify the queue to read messages from. You can also optionally set up default replies to a queue whenever a message is read and processed from the queue.
By creating a Process using RabbitMQ Trigger and activating said Process, the Frends Agent will start listening for messages from the queue and trigger the Process as necessary to handle the messages.
Configuration
To set up a RabbitMQ Trigger, add the shape to Process canvas and connect it as part of your Process. After that, you can select the Trigger type and configure the parameters for it.
The common parameters available for all Triggers are explained on the Trigger reference page. The following configuration parameters are available for RabbitMQ Trigger.
Queue
Name of the queue to listen to for messages. Environment Variables can be used here to use different queues for each Environment.
Connection string
Connection string in the format of AMQP 0-9-1 URI for the RabbitMQ broker.
Max concurrent messages
Numerical field to specify how many messages should at most be handled simultaneously. Essentially sets the maximum number of concurrent Process Instances for this Process. Each Process Instance will always handle a single message at a time.
Retry message processing if exception thrown
Toggle option to set whether failed Process execution will acknowledge the processed message. When enabled, the failed message will be returned to the queue and reprocessed, triggering the Process again.
Reply
Toggle switch to select whether or not an automatic reply is sent to a queue when a message is successfully processed from the queue. Reply contents will be the Process result for a successful execution.
Target queue for the replies is set in Default reply queue field.
Reply errors
Toggle switch to select whether or not an automatic reply is sent to a queue when the Process execution fails to handle a message. Reply contents will be the Process result for a failed execution.
Target queue for the replies is set in Default reply queue field.
Default reply queue
Text field to specify the queue replies are sent to. Environment Variables can be used here to use different queues for each Environment.
Do not log trigger parameters
Toggle option that when enabled, hides the Trigger parameters from being logged in Process Instances.
Reference Values
In addition to the default Trigger reference values, RabbitMQ Trigger provides the following additional values.
#trigger.data (Frends.ExecutableProcess.CaseInsensitivePropertyTree)
Object containing the data derived from input parameters and the resulting data from processing the Trigger.
#trigger.data.BasicProperties (Dictionary<String, String>)
Message properties set by the publisher of the message, at the time of publishing. You can learn more about the message properties at https://www.rabbitmq.com/docs/publishers#message-properties.
#trigger.data.Body (String)
Contents of the message body.
#trigger.data.ConsumerTag (String)
Message delivery and routing property, set by RabbitMQ broker during routing and delivery.
Identifies the message's consumer or subscription which consumed the message.
#trigger.data.DeliveryTag (Integer)
Message delivery and routing property, set by RabbitMQ broker during routing and delivery.
Identifies the delivery (transaction from broker to consumer) of the message uniquely as incremental positive integer within the channel or queue.
#trigger.data.Exchange (String)
Message delivery and routing property, set by RabbitMQ broker during routing and delivery.
Identifies the exchange or node that delivered the message.
#trigger.data.Redelivered (Boolean)
Message delivery and routing property, set by RabbitMQ broker during routing and delivery.
Boolean value, which is set to True if the message has been delivered and requeued earlier.
#trigger.data.RoutingKey (String)
Message delivery and routing property, set by RabbitMQ broker during routing and delivery.
Identifies the target queue the publisher sent the message for. As the routing key can use wildcards, it allows the exact receiving queue to vary from the specified.
Last updated
Was this helpful?