Queue triggers enable triggering Processes on messages received from an AMQP 1.0 queue. The queue trigger consumes the message from the queue whenever there is a new message available in the queue. The contents of the consumed message are then available in the process for further processing.
Configuring Queue Triggers
The queue trigger offers the following configuration properties to connect to a specified queue.
Queue- The name of the AMQP queue which to listen to
Bus Uri- The URIfor the AMQP Bus, e.g. amqps://owner:@.servicebus.windows.net:5671
Reply- Should we send the succeeding process result to the Queue specified by the
Reply Errors- Should we send failing process result to to the Queue specified by the
Reply To- The queue where we should send the replies to
Queue is durable- If set, the queue is expected to be durable, i.e. it will survive possible broker restarts.
This setting needs to match the actual configuration of the queue, if it has been created beforehand.
Please note that this setting is only recognized by FRENDS Agents in version 5.2.4 and above.
Trigger Reference List
#trigger.data.body- The body of the message.
#trigger.data.applicationProperties- The custom headers of the message
#trigger.data.properties- The AMQP message properties, for details see for details see http://docs.oasis-open.org/amqp/core/v1.0/os/amqp-core-messaging-v1.0-os.html#type-properties
The Queue trigger receives and accepts(completes) messages from the queue as they arrive with the limit of 10 concurrent messages being processed per Queue trigger per Agent. If configured to do so, the trigger will send a reply message to the 'Reply To' queue when the process finishes.
Note: The AMQP body may contain different types of data. Most of the time this provided as is to the process, the exception being when the body is a byte array and the property 'ContentType' has the 'Charset' field set, e.g. 'text/plain; charset=UTF-8'. In this case the binary data is converted to a string with the encoding matching the charset.
If the Process failed and
Reply Errors was selected, the exception that caused the failure will be written to the reply message. The message will have a new Guid as the MessageId and the same CorrelationId as the original trigger message.
When replying a success to a queue, the result is is written as the body of the message. Complex structures(objects) are serialized by default as JSON. In this case the Correlation Id of the triggering message is copied to the reply message.
It is possible to define the message structure directly in the result. This is done when the result contains an object which has at least either of the properties
ApplicationProperties. In this case the result object is mapped directly as the reply message with the following structure:
Body: object - the body of the reply message
ApplicationProperties: Dictionary<string, object> - the custom headers for the message
Properties - the AMQP message properties