Getting started with Microsoft Azure Service Bus

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.

This page contains information to help you get started with Azure Service Bus in Semarchy xDI.

Create Azure Service Bus metadata

The Azure Service Bus metadata holds information about:

  • Azure Service Bus namespaces

  • Message queues

This metadata can be used in processes through Azure Service Bus actions with Semarchy xDI metadata features like referencing, configuration, and more.

To create Azure Service Bus metadata:

  1. Right-click the folder where you want to create the metadata, then click New > Metadata. The New Metadata window displays.

  2. Select azure.service.bus > Microsoft Azure Service Bus, then click Next.

  3. Type a name for the metadata model and click Finish. The metadata is created.

Set metadata properties

Open the metadata, select the namespace node, and go to the Standard tab to set properties. The following properties must be set:

Property Description

Name

Namespace display name in Designer.

Module

The Designer module in use for this metadata.

Connection String

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

Add a queue node

Right-click the namespace node and select New  Queue. Define the following properties for the queue:

Property Description

Name

Queue display name in Designer.

Physical Name

Name of the queue in Azure Service Bus

Define other queues if necessary.

Create processes

You can create or modify processes using Azure Service Bus actions available in the Connectors tab of the Process Palette.

Actions

The Microsoft Azure Service Bus component adds the following Process actions:

Action Description

Azure Service Bus Create Queue

Creates a queue in the current Azure Service Bus namespace.

Azure Service Bus Delete Queue

Deletes a queue in the current Azure Service Bus namespace.

Azure Service Bus Send Message

Sends Azure Service Bus messages in a specified queue.

Azure Service Bus Receive Message

Receives Azure Service Bus messages in a specified queue.

Create or delete queues

To create or delete a message queue in a process, add the Azure Service Bus Create Queue or Azure Service Bus Delete Queue actions to a process, then set up the actions:

  1. Drag and drop a namespace metadata or a queue node onto the action.

  2. If you dragged and dropped a namespace metadata, configure the Queue Name parameter.

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

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

Send messages

To send messages, add the Azure Service Bus Send Message action to your process, then set up the action:

  1. Drag and drop a namespace metadata or a queue node onto the action.

  2. If you dragged and dropped a namespace metadata, configure the Queue Name parameter.

  3. Define the message to be sent in the Expression Editor.

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

Receive messages

To receive messages from a queue, add the Azure Service Bus Receive Message action to your process, then set up the action:

  1. Drag and drop a namespace metadata or a queue node onto the action.

  2. If you dragged and dropped a namespace metadata, configure the Queue Name parameter.

  3. Set the Max Messages and Max wait time parameters.

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

This action exposes received messages as a bind, and must be linked to a target action with a bind link. The target action can retrieve various message information, exposed as the following variables:

  • MESSAGE_ID: unique id linked to the message

  • CREATION_TIME: timestamp representing when a message was inserted into the queue.

  • MESSAGE_CONTENT: body of the message.

  • SEQUENCE_NUMBER: position of the message in the queue.

Miscellaneous

Statistics

The following statistics variables are available on the actions:

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

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