Azure Service Bus Listener

The Azure Service Bus Listener reads/consumes the messages from a Queue or Topic. You can create Azure Service Bus Listener, and use it in a Template/Transaction or with a Process Flow to consume and process the messages by following the instructions given in the sections below.

Creating and using Azure Service Bus Listener with a Process Flow

Follow the steps given below to create and use Azure Service Bus Listener with a Process Flow. 

The Azure Service Bus Listener created from the manage page is available to be used only in a process flow.

  1. Click Configure > EVENTS > Azure Service Bus Listener.
  2. Click Create Azure Service Bus Listener.
  3. On the Create Azure Service Bus Listener window, enter the following details:


    Field NameDescription
    Name

    A short, descriptive name that helps you re-use this listener in future.

    Description

    A short Description for the Azure Service Bus Listener.

    Azure Service Bus Account

    The account with which you want to associate the listener. You can also click  to add a new account.

    Important tip

    If you have set the Authentication Type as Shared Access Signature while creating the Azure Service Bus account, but the Connection String does not have manage and read claim, the list of topics/queues will not be auto populated in the Topic/Queue field. In this case, you can enter the queue/topic name manually.

    Azure Service Bus Type

    This field that governs the type (Queue, or Topic) of service bus you want to select for processing the messages.

    You can select QUEUE or TOPIC as the Azure Service Bus Type. Based on your selection, the input fields that follow will differ.

    1. If you select TOPIC as the Azure Service Bus Type, you need to select the Topic and the name of the subscription from which you want to receive the messages.
    2. If you select QUEUE as Azure Service Bus Type, you need to select the name of the queue from which you want to receive the messages.
    Session Enable

    Service Bus sessions handling option to enable ordered handling of unbounded sequences of related messages. To enable session handling, select the checkbox SessionEnable. If you enable session handling, you need to provide the session Id – An application-defined identifier that's unique to the session – in the next field to join an existing session.

    When sessions are enabled on a queue or a subscription, the client applications can no longer send/receive regular messages. All messages must be sent as part of a session (by setting the session id) and received by accepting the session.
    Process All SessionsOption to process all the messages irrespective of their Session IDs.
    Max Concurrent Sessions

    The maximum number of concurrent sessions that can be established for a Service Bus queue or subscription.

    This field is available only when you select Session Enable and Process All Sessions checkboxes.
    Max Concurrent Calls

    The maximum number of concurrent message handlers that can process messages from a particular queue or subscription.

    This field is available only when you select Session Enable and Process All Sessions checkboxes.
    Max Auto Lock Renew Duration

    The maximum duration (in minutes) for automatically renewing a lock on a message during message processing.

    This field is available only when you select the Process All Sessions checkbox. 

    Session Timeout

    The maximum duration (in hours) for which the Azure Service Bus Listener will keep checking for the message. If no message is received during this period, the session gets timed out and listener would not process any message further.

    This field is available only when you select the Process All Sessions checkbox. 

    Process Flow

    The field to select the Process Flow that you want to use for processing the azure service bus messages.

    The Azure Service Bus Listener that you create will be used with the Process Flow that you select in this field. If you are creating the listener from within a Template, this field will not be displayed as the listener will by default be created for the Template.
    PreFetch CountSets the prefetch count of the receiver to speed up the message flow and makes the messages available for local retrieval. Setting a non-zero value will prefetch that number of messages.
    Enable Message Aggregator

    The field that enables aggregation and processing of the messages. To enable this feature, select the checkbox Enable Message Aggregator. If you enable message aggregator, you need to provide the following information.

    1. Number of Messages for Aggregation: Define the number of messages you want to aggregate. The default value for this field is 0.

    2. Aggregation Timespan: Provide time in seconds for which the received messages will keep on aggregating. The default value for this field is 0.

      Important

      The fields Number of Messages for Aggregation and Aggregation Timespan work in coordination with each other. The messages that a consumer receives are combined into a single message and sent for processing based on the value for these fields, for example:

      1. If Aggregation Timespan is 0 and Number of Messages for Aggregation is 5: the aggregator waits for the receival of 5 messages, irrespective of the time taken to receive those messages. Once 5 messages are received, they are combined into a single message and sent it for processing.
      2. If Aggregation Timespan is 60 seconds and Number of Messages for Aggregation is 0: the consumer keeps receiving the messages until 60 seconds, and then aggregates all the messages received during the time span of 60 seconds. The aggregated messages are combined into a single message and sent for processing.
      3. If Aggregation Timespan is 60 seconds and Number of Messages for Aggregation is 5: the condition that is met first takes precedence. The message aggregation completes when the time span reaches 60 seconds or the number of received messages reach 5. The aggregated messages are combined into a single message and sent for processing.
    3. Message Types: Select the data format – JSON, XML, or PLAINTEXT – of the messages based on which you want to aggregate them.

    4. Message Joiner: Enter the delimiter based on which the messages will be aggregated. It depends on the Message Type.
      • If the Message Type is JSON: Enter an element name. This field can also be left blank.
      • If the Message Type is XML: Enter an XPath.
      • If the Message Type is PLAINTEXT: Enter a delimiter.
  4. Expand the Retry Options and the enter value for the following fields:

    Field Name

    Description

    Max Retries

    The maximum number of attempts made by the Azure Service Bus Listener to check for the new messages.

    Retry Delay

    The frequency (in seconds) at which the Azure Service Bus Listener checks for a new message.

    Retry Mode

    Defines if the value for the Retry Delay field is fixed or exponential in nature.

    • Fixed: Azure Service Bus checks for a new message at a fixed interval (value provided in Retry Delay field).
    • Exponential: Refers to the exponential increase in message checking frequency at every attempt. This increase is calculated as Retry Delay * Max Retries

    Max Retry Delay

    The maximum permissible delay between message checking attempts.

    This field is available only when you set the value for the Retry Mode field to Exponential


  5. Expand the Advanced Properties and enter the email id(s) separated by a comma in the Notification Receiver Email-ID(s) field to receive notifications on message failure.
  6. Select the required project in the Select Project field.
  7. Important

    Once you save the Azure Service Bus Listener, make sure that the following conditions are met to receive the messages.

Creating Azure Service Bus Listeneand using it in a Template

To use Azure Service Bus Listener in a Template, you need to create it from within the Template itself. Follow the steps given below to create Azure Service Bus Listener from within a Template.

You can also allow the Partner to create Azure Service Bus Listener by clicking Partner will define this step check box. The Partner will be able to create Azure Service Bus Listener while creating a Transaction using this Template.

  1. While creating the Template, select Azure Service Bus as a source application.



  2. In the Which event should trigger the data transfer? field, select New Message and click Next.



  3. In the Provide Azure Service Bus account information field, select the Azure Service Bus account and click Next.



  4. On the Azure Service Bus Settings page, provide the information required for each field. For more details refer to this table
  5. Click Next.
  6. Complete rest of the steps in the wizard.

    This creates the Azure Service Bus Listener which is used with the Template to consume and process the messages.

Activating or deactivating the Azure Service Bus Listener

You can activate (turn on) or deactivate (turn off) an Azure Service Bus Listener by toggling  on the Azure Service Bus Listener manage page.

The option to turn the Azure Service Bus Listener ON or OFF is available only for the listener that have been created from the manage page.
  • Once turned on, the listener starts consuming the messages from Azure Service Bus Server and triggers the process flow for processing the received messages.
  • Once turned off, the listener stops receiving Azure Service Bus messages from server.

Setting the Event Context Enabled property

Perform the following steps to enable the Event Context Enabled property in the process flow.

  1. Select the Source service and then click View Properties on the context pad menu. 
  2. In the Activity Properties panel, under the GENERAL tab, click the toggle switch to turn on the Event Context Enabled property.
  3. Save the process flow.

Related Topics

Azure Service Bus

Azure Service Bus Target