Skip to main content

Queue Trigger

Start a Process by receiving a message from an AMQP queue.

Ossi Galkin avatar
Written by Ossi Galkin
Updated over a year ago

Queue Trigger enables 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 URI for the AMQP queue, e.g. amqps://owner:@.servicebus.windows.net:5671

  • Reply - Should we send the succeeding Process result to the Queue specified by the ReplyTo option 

  • Reply Errors  - Should we send failing Process result to to the Queue specified by the Reply To option

  • 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.

Trigger Reference List

Receiving messages

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.

Reply messages

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 CorrelationId 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 Body or 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
MessageId; string
AbsoluteExpiryTime: DateTime
ContentEncoding: string
ContentType: string
CorrelationId: string
CreationTime: DateTime
GroupId: string
GroupSequence: uint
ReplyToGroupId: string
ReplyTo: string
Subject: string
UserId: byte[]
To: string

        

        

          

            

Did this answer your question?