Getting started with Microsoft Azure Service Bus

Microsoft Azure Service Bus is a cloud messaging service used to connect applications, devices, and services running in the cloud to any other applications or services.

Follow this guide to get started with Azure Service Bus in Semarchy xDI.

Overview

Work with component-name in Semarchy xDI using metadata and process actions.

Azure Service Bus metadata objects hold information about Azure Service Bus namespaces, queues, subscriptions, and topics.

Azure Service Bus process actions inherit metadata information. Use these process actions to work with messages, or manage queues, subscriptions, and topics.

Create Azure Service Bus metadata

To create Azure Service Bus metadata:

  1. Open a project in xDI Designer.

  2. From the project folder context menu, or the File menu, select New > Metadata. The New Metadata window opens.

  3. Select the Microsoft Azure Service Bus entry, then click Next.

  4. Type a name for the metadata model and click Next.

  5. Create or select a module with the necessary libraries, and click Finish. The metadata opens.

Set metadata properties

Open the metadata and select the top-level node. Navigate to its properties window, to the Standard finger tab.

Set the following parameters:

Parameter Description

Name

Display name for the root namespace node in Designer.

Module

Designer module to use for this metadata.

Use Default Credentials

Enable or disable the DefaultCredentials authentication method.

This authentication method searches the execution environment for credentials. See the Microsoft documentation for more details.

Connection String

Full namespace connection string to use for identification with a Shared Access Signature (SAS) policy.

This option appears if Use Default Credentials is unchecked.

Physical Name

The remote name of the namespace in Azure.

This option appears if Use Default Credentials is checked.

Add other metadata elements

From the top-level namespace node, you can define queues, topics, and subscriptions in the metadata. Defining them here allows process actions to inherit their names and properties when you design a process. However, you can define these elements directly in the actions if you prefer.

To add queue or topic elements, open the context menu for the top-level namespace node, and select New  Queue or New  Topic. To add subscription elements, open the context menu for a topic node, and select New  Subscription.

Define the following properties for new elements you create:

Property Description

Name

Display name in Designer.

Physical Name

Remote name of the element in Azure Service Bus

For subscription nodes, you can also define a max delivery count. This number sets how many times Azure Service Bus Azure Service Bus attempts to deliver a message before sending it to the dead-letter queue.

Add and configure other elements as needed.

Design processes

Create or open a process in xDI Designer.

Go to the Process Palette, then to the Connectors subsection. Add the Azure Service Bus actions to your process, configure them, and link them to design your integration flow.

Send messages

You can send messages to a queue or topic. Use these dedicated actions in your process to send messages:

Set up the actions:

  1. Drag and drop a top-level Azure Service Bus metadata node or one of its subnodes onto the action.

    • If you used a top-level namespace node, configure all other action parameters.

    • If you used another node, the action inherits related parameter fields. Define any fields that were not inherited, or that you want to override.

  2. Set other parameters, such as scheduling options.

  3. In the action’s Expression Editor, enter the message you want to send.

  4. Link the action to other parts of the process.

Receive messages

You can receive messages from a queue or subscription. Use these dedicated actions in your process to receive messages:

Set up the actions:

  1. Drag and drop a top-level Azure Service Bus metadata node or one of its subnodes onto the action.

    • If you used a top-level namespace node, configure all other action parameters.

    • If you used another node, the action inherits related parameter fields. Define any fields that were not inherited, or that you want to override.

  2. Set other parameters, such as maximum message retrieval.

  3. Link the action to other parts of the process.

These actions expose received messages as a bind, and must be linked to target actions with a bind link. The target actions can retrieve message information, exposed as variables. See the action documentation for detailed information.

Manages queues, topics and subscriptions

You can create and delete queues, topics, and subscriptions. Add these dedicated actions to your process to perform the relevant action:

Set up the actions:

  1. Drag and drop a top-level Azure Service Bus metadata node or one of its subnodes onto the action.

    • If you used a top-level namespace node, configure all other action parameters.

    • If you used another node, the action inherits related parameter fields. Define any fields that were not inherited, or that you want to override.

  2. Optionally, toggle the checkbox Fail if exists/not exists to continue on action failure.

  3. Link the action to other parts of the process.

Miscellaneous

Statistics

The send and receive actions expose statistics through process variables:

  • AZURE_SERVICE_BUS_SENT_MESSAGES: number of messages sent using Send Message actions.

  • AZURE_SERVICE_BUS_RECEIVED_MESSAGES: number of messages received using Receive Message actions.