Service Bus Trigger
Listening for Azure Service Bus messages.
In order to launch a Process through Azure Service Bus messaging queues or topic subscriptions, Service Bus Trigger can be used.
You can learn more about Triggers in general here.
What is Service Bus Trigger?
Service Bus Trigger is like AMQP Trigger, and listens for new messages in Azure Service Bus queues and topics, 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 Service Bus Trigger, you should set up a messaging queue or topic and subscription beforehand, and then connect the Trigger to it through its connection string as well as specify the queue to read messages from. Alternatively, you can specify the topic and subscription name instead of queue name to listen for topics instead. You can also optionally set up default replies to a queue whenever a message is read and processed from the queue, as well as whether to consume the messages immediately or not.
By creating a Process using Service Bus Trigger and activating said Process, the Frends Agent will start listening for messages from the bus and trigger the Process as necessary to handle the messages.
Configuration
To set up a Service Bus 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 Service Bus Trigger.
Queue
Name of the queue to listen to for messages.
Alternatively, names of the topic and subscription to listen to can also be specified in this field. Enter the name of topic and subscription in format <my-topic>/subscriptions/<my-subscription>, for example alerts/subscriptions/frends-sub.
Environment Variables can be used here to use different queues, topics and subscriptions for each Environment.
Connection string
Connection string for the Azure Service Bus.
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.
Max receive count (optimization)
Numerical field to specify how many times Frends allows retrying a failed message before dead-lettering it. Defaults to 1, while recommended value usually falls in range of 5 to 10. Value can be left empty to disable dead-lettering from Frends.
Consume message immediately
Toggle option to select the method how messages are consumed from Service Bus. Enabled by default, the incoming messages are acknowledged immediately when Process executes, removing them from the queue.
When disabled, the Trigger utilises PeekLock receive mode, leaving the message to the queue until the Process has executed successfully.
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.
Parameter is disabled if messages are consumed immediately.
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, AMQP 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.body (String)
Contents of the message body.
#trigger.data.properties (Dictionary<String, String>)
The built-in broker properties provided by Azure Service Bus for the message, as well as any custom properties for the message.
Last updated
Was this helpful?