Contact Free trial Login

Microsoft Service Bus Connector - Mule 4

Support Category: Select

Microsoft Service Bus Connector v2.1

Anypoint Connector for Microsoft Service Bus (Microsoft Service Bus Connector) enables message integration with Windows Service Bus on-premises. The connector supports communication with queues and topics through Advanced Message Queuing Protocol (AMQP) 1.0. In addition, dynamic discovery and provisioning of Service Bus objects is possible using the built-in management API. To implement message integration scenarios with Microsoft Azure, use the Microsoft Azure Service Bus Connector, which is available for Mule 3 users, instead of this connector.

Prerequisites

To use this information, you should be familiar with Microsoft Service Bus, Mule runtime engine (Mule), Anypoint Connectors, Anypoint Studio, Mule concepts, elements in a Mule flow, and Global Elements.

You need one of the following credential types to test your connection to your target resource:

  • SAS (shared access signature)

  • Username and password

  • Windows credentials type

For software requirements and compatibility information, see the Connector Release Notes.

To use this connector with Apache Maven, click the Dependency Snippets link in Anypoint Exchange.

The connector supports the Microsoft Windows Service Bus on-premises.

POM File Information

<dependency>
  <groupId>com.mulesoft.connectors</groupId>
  <artifactId>mule-microsoft-service-bus-connector</artifactId>
  <version>RELEASE</version>
  <classifier>mule-plugin</classifier>
</dependency>

Mule converts RELEASE to the latest version. To specify a version, view Microsoft Service Bus Connector in Anypoint Exchange and click Dependency Snippets.

Connect in Flow Designer

  1. In Flow Designer, click one of the following triggers:

    • Microsoft Windows Service Bus Connector: Listen for changes in a queue, topic, or a custom object.

    • HTTP Listener: Listen for input from a browser, or a command such as curl or Postman.

    • Scheduler: Activate your app at specified time intervals.

      Trigger options
  2. Select the plus sign to add a component.

    add connector
  3. Select the connector as a component.

  4. Configure one of Global elements for the connector:

    • Configuration

      Configuration
      General

      Field

      Description

      Connection Type

      The type of connection: Shared Access Signature, Username and Password, or Windows.

      Encoding

      The default encoding of the message body to be used if the message doesn’t communicate it.

      Content Type

      The default contentType of the message body to be used if the message doesn’t communicate it.

      Ack Mode

      The Session ACK mode to use when consuming a message.

      Consumer Type

      Used by default when consuming a message that can be overridden at the message source level.

      Selector

      Default JMS selector to be used for filtering incoming messages.

      Persistent Delivery

      If true, the message is sent using the PERSISTENT JMSDeliveryMode.

      Priority

      The default JMSPriority value to be used when sending the message.

      Time To Live

      Defines the default time the message ise in the broker before it expires and is discarded.

      Time To Live Unit

      Time unit to be used in the Time To Live configurations.

      Disable Message Id

      If true, the message is flagged to avoid generating its MessageID.

      Disable Message Timestamp

      If true, the message is flagged to avoid generating its sent Timestamp.

      Delivery Delay

      Sets the delivery delay to be applied to postpone the message delivery.

      Delivery Delay Unit

      Time unit to be used in the Delivery Delay configurations.

      Jms Type

      The message type identifier to be set in the JMS type header when a message is sent.

      Queue Prefetch

      Number of messages that the remote peer can send to the client and hold in a prefetch buffer for each consumer instance.

      SAS (Shared Access Signature) Connection:

      General
      Blob Storage Connection

      Connection

      General

      Field

      Description

      Connection Type

      Shared Access Signature

      Blob Storage Connection

      Field

      Description

      Storage Access Key

      Access key from your Storage

      Container Name

      Container’s name

      Storage Account Name

      Account name from storage

      Connection

      Field

      Description

      Service Namespace

      The namespace for the Azure Service Bus Service within your subscription.

      Shared Access Signature

      The unique security token when you set up just one security profile to access all your service resources. In this case when the token has expired, the connector cannot reconnect automatically and you need to stop running the flow to update this configuration setting with a new token.

    • Username and Password Connection

      General
      Blob Storage Connection

      Connection

      General

      Field

      Description

      Connection Type

      Username Password

      Blob Storage Connection

      Field

      Description

      Storage Access Key

      Access key from your Storage

      Container Name

      Container’s name

      Storage Account Name

      Account name from storage

      Connection

      Field

      Description

      Shared Access Key Name

      Enter the name of access key configured on the namespace. Any access key created at a lower level (that is, a Topic level Shared Key) does not work with this option, unless you disable the connectivity test at startup.

      Shared Access Key

      Enter the 256-bit primary key.

      Service Namespace

      Enter the name of the service namespace to address Service Bus resources within your application.

    • Windows Connection

      General
      Connection
      General

      Field

      Description

      Connection Type

      Windows

      Connection

      Field

      Description

      Service Namespace

      Enter the name of the service namespace to address Service Bus resources within your application.

      Username

      Enter the user to use for authentication.

      Password

      Enter the password of the user.

      Fully Qualified Domain Name

      Enter the fully qualified domain name of your Windows Service Bus server

      Port

      Enter the server port number.

      Disable SSL Certificate Validation

      If you are using a self-signed SSL certificate, select this check box.

      Skip connectivity test

      In case you have limited access to Windows Service Bus resources and you want to skip the connectivity test performed at startup you need to set this setting to true.

Sources

Queue Receive

  1. Click a trigger and select ServiceBus > Queue Receive

    Queue Source
  2. Fill Global configuration for this connector as we explained in Operations Section

  3. Complete the source parameters:

    Field Description

    Source Queue

    Queue that is going to receive events.

    Disable Auto Acknowledge

    Check this, if you want to Acknowledge events manually with Acknowledge Message operation

    Ack Mode

    The Session ACK mode to use when consuming a message.

    Selector

    Default JMS selector to be used for filtering incoming messages.

    Number Of Consumers

    The number of concurrent consumers to use to receive JMS messages.

    Body

    The body of the message.

    JMS Type

    The JMSType identifier header of the message.

    Correlation ID

    The JMSCorrelationID header of the message.

    Send Content Type

    Whether or not the body content type should be sent as a property.

    Content Type

    The content type of the Message body.

    Send Encoding

    Whether or not the body outboundEncoding should be sent as a Message property.

    Encoding

    The encoding of the message body.

    Reply To - Destination

    The destination where a reply to this Message should be sent.

    Reply To - Destination Type

    The type of this destination.

    User Properties

    The custom user properties that should be sent to the message.

    JMSX Properties

    JMS reserves the JMSX property name prefix for JMS defined properties. Here we define the set of 'well known' properties of JMS.

    Persistent Delivery

    If true, the message is sent using the PERSISTENT JMSDeliveryMode.

    Priority

    The default JMSPriority value to be used when sending the message.

    Time To Live

    Defines the default time the message is in the broker before it expires and is discarded.

    Time To Live Unit

    Time unit to be used in the Time To Live configurations.

    Disable Message Id

    If true, the message is flagged to avoid generating its MessageID.

    Disable Message Timestamp

    If true, the message is flagged to avoid generating its sent Timestamp.

    Delivery Delay

    Sets the delivery delay to be applied to postpone message delivery.

    Delivery Delay Unit

    Time unit to be used in the Delivery Delay configurations.

Topic Receive

  1. Click a trigger and select ServiceBus > Topic Receive

    Queue Source
  2. Fill Global configuration for this connector as we explained in Operations Section

  3. Complete source parameters

    Field Description

    Disable Auto Acknowledge

    Check this, if you want to Acknowledge events manually with Acknowledge Message operation

    Ack Mode

    The Session ACK mode to use when consuming a message.

    Selector

    Default JMS selector to be used for filtering incoming messages.

    Body

    The body of the Message.

    JMS Type

    The JMSType identifier header of the Message.

    Correlation ID

    The JMSCorrelationID header of the Message.

    Send Content Type

    Whether or not the body content type should be sent as a property.

    Content Type

    The content type of the Message body.

    Send Encoding

    Whether or not the body outboundEncoding should be sent as a Message property.

    Encoding

    The encoding of the Message body.

    Reply To - Destination

    The destination where a reply to this Message should be sent

    Reply To - Destination Type

    The type of this destination.

    User Properties

    The custom user properties that should be sent to the message

    JMSX Properties

    JMS reserves the 'JMSX' property name prefix for JMS defined properties. Here we define the set of 'well known' properties of JMS.

    Persistent Delivery

    If true, the Message is sent using the PERSISTENT JMSDeliveryMode

    Priority

    The default JMSPriority value to be used when sending the message.

    Time To Live

    Defines the default time the message is in the broker before it expires and is discarded.

    Time To Live Unit

    Time unit to be used in the Time To Live configurations.

    Disable Message Id

    If true, the Message is flagged to avoid generating its MessageID.

    Disable Message Timestamp

    If true, the Message is flagged to avoid generating its sent Timestamp.

    Delivery Delay

    Sets the delivery delay to be applied in order to postpone the Message delivery.

    Delivery Delay Unit

    Time unit to be used in the Delivery Delay configurations.

    Topic Path

    General Topic that you want to listen to a specific subscription.

    Subscription Path

    Subscription where you are going to receive events.

Add the Connector to a Studio Project

Anypoint Studio provides two ways to add the connector to your Studio project: from the Exchange button in the Studio taskbar or from the Mule Palette view.

Add the Connector Using Exchange

  1. In Studio, create a Mule project.

  2. Click the Exchange icon (X) in the upper-left of the Studio task bar.

  3. In Exchange, click Login and supply your Anypoint Platform username and password.

  4. In Exchange, search for "service bus".

  5. Select the connector and click Add to project.

  6. Follow the prompts to install the connector.

Add the Connector in Studio

  1. In Studio, create a Mule project.

  2. In the Mule Palette view, click (X) Search in Exchange.

  3. In Add Modules to Project, type "service bus" in the search field.

  4. Click this connector’s name in Available modules.

  5. Click Add.

  6. Click Finish.

Configure in Studio

  1. Drag a connector’s operation to the Studio Canvas.

  2. Configure the Global element for the connector.

    Configuration values for each Connection type are the same as in the To Connect in Design Center section.

General

Use Case: Get Queue list

General
  1. Create a new Mule Application on your Studio and select an HTTP Listener as a Source in the new flow.

  2. Add a new HTTP Listener Configuration global element:

  3. Specify Host and port parameters with the following values:

    Parameter Value

    Host

    0.0.0.0

    Port

    8081

  4. Click the Save button.

  5. Assign your new Global configuration to your HTTP Listener.

  6. Fill in HTTP Listener path with /servicebus value.

  7. Drag a new Service Bus component operation in the flow.

  8. Configure the Service Bus connector global element with its environment values.

  9. Add a transform message before the Connector and add an output like this:

%dw 2.0
output application/json
---
payload

+ * Save and run the project as a Mule Application.

+ To test the app, navigate to http://127.0.0.1:8081/servicebus.

XML flow:

<?xml version="1.0" encoding="UTF-8"?>

<mule xmlns:ee="http://www.mulesoft.org/schema/mule/ee/core"
xmlns:servicebus="http://www.mulesoft.org/schema/mule/servicebus"
	xmlns:http="http://www.mulesoft.org/schema/mule/http"
	xmlns="http://www.mulesoft.org/schema/mule/core"
	xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://www.mulesoft.org/schema/mule/core
	http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/http
http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/servicebus
http://www.mulesoft.org/schema/mule/servicebus/current/mule-servicebus.xsd
http://www.mulesoft.org/schema/mule/ee/core
http://www.mulesoft.org/schema/mule/ee/core/current/mule-ee.xsd">
	<configuration-properties file="mule-app.properties" />
	<http:listener-config name="HTTP_Listener_config" doc:name="HTTP Listener config" >
		<http:listener-connection host="0.0.0.0" port="8081" />
	</http:listener-config>
	<servicebus:config name="Servicebus_Config" doc:name="Servicebus Config" >
		<servicebus:windows-connection
		namespace="${config.namespace}"
		username="${config.username}"
		password="${config.password}"
		fqdn="${config.fqdn}" />
	</servicebus:config>
	<flow name="servicebusFlow">
		<http:listener doc:name="Listener" config-ref="HTTP_Listener_config"
		path="/servicebus"/>
		<servicebus:queues-list doc:name="Queues list" config-ref="Servicebus_Config"/>
		<ee:transform doc:name="Object to JSON">
			<ee:message >
				<ee:set-payload ><![CDATA[%dw 2.0
output application/json
---
payload]]></ee:set-payload>
			</ee:message>
		</ee:transform>
	</flow>
</mule>

Service Bus Authentication

For sending and receiving messages through the Service Bus connector, the authentication is performed through AMQP.

For the REST Management API, the authentication scheme differs based on the Microsoft Service Bus version. The Windows Service Bus running on premises uses OAuth and the Azure Service Bus running on the cloud uses a Shared Access Key token.

The Windows Service Bus uses a self-signed SSL certificate to secure the communication via AMQP and HTTPS. The connector won’t run if this certificate is not locally imported in the box running Mule, unless the Ignore SSL warning check is enabled.

To enable the SSL checks, the certificate must be imported following these steps:

  1. Use the PowerShell cmdlet Get-SBAutoGeneratedCA to download the certificate locally in the box running the Windows Service Bus. For the purposes of this tutorial, assume the certificate file is exported to %temp%\AutoGeneratedCA.cer.

  2. Go to %programfiles%\Java\jre7. Verify that the bin\keytool.exe tool exists, and that lib\security\cacerts exists. Note that you must be running as Administrator in order to perform a certificate import with Keytool.exe. Otherwise, an Access Denied error is generated.

  3. Enter the following command: bin\keytool.exe –list –keystore lib\security\cacerts

  4. Import the autogenerated Service Bus certificate by running the following command: bin\keytool.exe –importcert –alias AppServerGeneratedSBCA –file %temp%\AutoGeneratedCA.cer –keystore lib\security\cacerts –v

  5. Enter the password when prompted (the default is “changeit”). If you do not know the password, you cannot perform the import. When the tool asks you whether to trust the certificate, enter Y (Yes).

SAS-Based Authentication

In addition to the connection schemes that require a username and password, the connector provides a connection in which authentication is SAS-based (only for Azure). This type of connection enables you to set the authentication token for the Service Bus service without requiring a username and password.

Because the SAS token schema is URI based (that is, you can assign different authorization access to your resources based on their URIs), the connection supports multiple ways of providing the needed authentication tokens. The simplest case is when you have one profile that authorizes accesses to all of your resources using a root URI that is the base endpoint that your service exposes. To provide different access tokens on different resources, use a setting that enables you to configure a list of tokens according to the resources the connector needs to access when it runs.

As an extension to the mechanisms described previously, you can also implement a custom token provider that enables the connector to request security tokens when it needs them. It is the responsibility of the app to solve each request and to return a fresh token every time the connector asks for one. Because the tokens expire, this mechanism allows the connector to re-authenticate with the target resource once the token expires, which is not allowed when tokens are specified at configuration time.

The following settings are available for the Shared Access Signature connection:

  • Service Namespace

    The namespace for the Azure Service Bus service within your subscription.

  • Shared Access Signature (optional)

    The unique security token to use when you set up one security profile to access all of your service resources.

    In this scenario, the connector cannot reconnect automatically after the token expires. Therefore, you must stop running the flow to update this configuration setting with a new token.

On the Advanced tab:

  • SAS tokens list (optional)

    The list of security tokens the connector needs for accessing different URIs when the security profiles for each URI differs.

    In this scenario, after a token expires, the connector cannot reconnect to the URI linked to that token. Therefore, you must stop running the flow to update this configuration setting with a new set of tokens.

  • SAS tokens provider (optional)

    A Spring bean reference implementing the org.mule.modules.microsoftservicebus.connection.providers.SharedAccessSignatureProvider interface.

    The following example shows how to configure a SAS token provider:

    <servicebus:config name="Microsoft_Service_Bus_Config"
       doc:name="Microsoft Service Bus Config" >
    <servicebus:shared-access-signature-connection
      blobAccountKey="muletest"
      blobContainerName="OTJZOwIql+mof78yt789TuAPJRhahuO0quQEFtBUn3yt0UTzjuF6dKH1MH5iGAalYwATUqXYjvH+7r/PLMLxEQ=="
      blobAccountName="test-container" namespace="mulesbft">
    <servicebus:tokens >
    <servicebus:token value="SharedAccessSignature sr=https%3a%2f%2fmynamespace.servicebus.windows.net%2f%24Resources%2fTopics&amp;sig=Pks8c5VB10KWRhQNshM%2fCR%2fwju%2bryi7WyE%2b9sm2KP12%3d&amp;se=1575485246&amp;skn=RootManageSharedAccessKey" />
    <servicebus:token value="SharedAccessSignature sr=https%3a%2f%2fmynamespace.servicebus.windows.net%2ftopictoken&amp;sig=L1JSM9cn6x9QnhzTB0P1wtjyvOkeLQ0o1SB59%2boWEc7%3d&amp;
    se=1576702491&amp;skn=RootManageSharedAccessKey" />
    </servicebus:tokens>
    </servicebus:shared-access-signature-connection>
    </servicebus:config>

    If you specify a token provider, you must provide a fresh token for each URI the connector requires access to, according to your security profiles. In this scenario, each time a token expires, the connector requests a new token, which your implementation must provide. Reconnection to the target URI then occurs seamlessly.

  • Max connections (optional)

    Maximum number of connections to keep in the pool in order to be reused by the producer.

    Set this value to -1 to create a new connection every time.

You must provide at least one optional setting and format the token as a string that complies with the following pattern:

SharedAccessSignature sr=[resource_uri]&sig=[signature]&se=[ttl]&skn=[profile]

The sr parameter value can start with https or amqps, depending on the operation to perform on the target resource:

SharedAccessSignature sr=amqps%3a%2f%2fmynamespace.servicebus.windows.net%2fMyQueue&sig=pSrfJn5uRTiepgOTjBpjcf2gw%2bG34S1MYdCfkQkTC8A%3d&se=101&skn=OperationalPolicyKey

Performance Considerations

The Claims Based Security mechanism required to authenticate to Azure Service Bus using a SAS token involves exchanging messages with a special node. The latest impacts on connector’s performance as tokens are exchanged per request in order to achieve connection security setup using targeted tokens (related to the resource being accessed). This has been optimized, starting from version 1.2, to impact performance as low as possible. Anyway, if your scenario requires sending several messages with high throughput it is recommended the connection strategy that requires setting the username and password. This is the simpler way to authenticate to Azure Service Bus with the connector while achieving better throughput, though it requires to write the password for the shared access key name you are using.

As said before, if you are experiencing performance issues when using the SAS strategy we recommend you updating to version 1.2 or higher. The optimized mechanism has lower performance impact on receiving and sending operations as the AMQP container and cache (respectively) keep the connection alive and token exchange messages occur only when setting up the connection and/or in case of token expiration.

Using Restricted Access Policies

In cases where you have restrict access to your resources, having a security policy with permissions just at resource level, the connector cannot perform the connectivity test when it is starting up as this targets the root level of your namespace which might be forbidden due to the customized policy applied to the shared access key. For these scenarios, you need to skip the connectivity test with the configuration option available to this purpose, otherwise connetor’s startup fails.

Log Requests and Responses

To log requests and responses when using the connector, configure a logger by adding this line to the Loggers element of the log4j2.xml configuration file for the Mule app:

<AsyncLogger name="org.springframework.web.client"
   level="DEBUG"/>

The following example shows the Loggers element with the AsyncLogger line added:

<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="WARN">
	<Appenders>
	    <Console name="Console" target="SYSTEM_OUT">
	    	<PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"/>
		</Console>
	</Appenders>
	<Loggers>
		<AsyncLogger name="org.springframework.web.client" level="DEBUG" additivity="false">
			<appender-ref ref="Console" level="debug"/>
		</AsyncLogger>
	</Loggers>
</Configuration>

You can view the app log as follows:

  • If you’re running the app from the Anypoint Platform, the output is visible in the Anypoint Studio console window.

  • If you’re running the app using Mule from the command line, the app log is visible in your OS console.

Unless the log file path was customized in the app’s log file (log4j2.xml), you can also view the app log in this default location:

MULE_HOME/logs/<app-name>.log

For more information about the app log, see Configuring Logging.

Use Case: Azure Service Bus AMQP

Studio 7 flows for the Azure Service Bus AMQP demo

XML for this flow:

<?xml version="1.0" encoding="UTF-8"?>

<mule xmlns:ee="http://www.mulesoft.org/schema/mule/ee/core"
xmlns:servicebus="http://www.mulesoft.org/schema/mule/servicebus"
xmlns:http="http://www.mulesoft.org/schema/mule/http"
xmlns="http://www.mulesoft.org/schema/mule/core"
xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.mulesoft.org/schema/mule/core
http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/http
http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/servicebus
http://www.mulesoft.org/schema/mule/servicebus/current/mule-servicebus.xsd
http://www.mulesoft.org/schema/mule/ee/core
http://www.mulesoft.org/schema/mule/ee/core/current/mule-ee.xsd">
	<configuration-properties file="mule-app.properties" doc:name="Configuration properties"/>
	<http:listener-config name="HTTP_Listener_config" doc:name="HTTP Listener config">
		<http:listener-connection host="0.0.0.0" port="8081" />
	</http:listener-config>
	<servicebus:config name="Microsoft_Service_Bus_Config" doc:name="Microsoft Service Bus Config">
		<servicebus:username-password-connection
			userName="${azure.keyname}"
			password="${azure.key}"
			namespace="${azure.namespace}" >
			<servicebus:caching-strategy >
				<servicebus:no-caching-configuration />
			</servicebus:caching-strategy>
		</servicebus:username-password-connection>
	</servicebus:config>
	<flow name="load-http-form-flow">
		<http:listener doc:name="Root Endpoint" config-ref="HTTP_Listener_config"
			path="/" />
		<parse-template doc:name="Web Form" location="form.html" />
	</flow>
	<flow name="queue-endpoint-flow">
		<http:listener doc:name="Queue Endpoint" config-ref="HTTP_Listener_config"
			path="/pushMessageQueue" />
		<ee:transform doc:name="Convert Payload to Java Object">
			<ee:message>
				<ee:set-payload><![CDATA[%dw 2.0
output application/java
---
payload]]></ee:set-payload>
			</ee:message>
		</ee:transform>
		<servicebus:queue-send doc:name="Queue send" config-ref="Microsoft_Service_Bus_Config"
			destinationQueue="#[payload.queue]">
			<servicebus:message >
				<servicebus:body ><![CDATA[#[payload.message]]]></servicebus:body>
			</servicebus:message>
		</servicebus:queue-send>
	</flow>
	<flow name="topic-endpoint-flow">
		<http:listener doc:name="Topic Endpoint" config-ref="HTTP_Listener_config"
			path="/pushMessageTopic"/>
		<ee:transform doc:name="Convert Payload to Java Object">
			<ee:message >
				<ee:set-payload ><![CDATA[%dw 2.0
output application/java
---
payload]]></ee:set-payload>
			</ee:message>
		</ee:transform>
		<servicebus:topic-send doc:name="Topic send" config-ref="Microsoft_Service_Bus_Config"
			destinationTopic="#[payload.topic]"
			transactionalAction="NOT_SUPPORTED"
			sendCorrelationId="AUTO">
			<servicebus:message >
				<servicebus:body ><![CDATA[#[payload.message]]]></servicebus:body>
			</servicebus:message>
		</servicebus:topic-send>
	</flow>
	<flow name="queue-receive-flow">
		<servicebus:listener
			sourceType="Queue"
			destination="${queue.name}"
			doc:name="Queue receive"
			config-ref="Microsoft_Service_Bus_Config"
			ackMode="AUTO" subscription="NONE"
			numberOfConsumers="1"/>
		<logger level="INFO" doc:name="Log the message" message="#[payload]"/>
	</flow>
	<flow name="topic-receive-flow">
		<servicebus:listener sourceType="Topic" doc:name="Topic receive"
			config-ref="Microsoft_Service_Bus_Config"
			ackMode="AUTO" destination="${topic.name}"
			subscription="${subscription.name}"/>
		<logger level="INFO" doc:name="Log the message" message="#[payload]"/>
	</flow>
</mule>

Use Case: Azure Service Bus Management

Azure Management Studio 7 Flow

XML flow:

<?xml version="1.0" encoding="UTF-8"?>

<mule xmlns:ee="http://www.mulesoft.org/schema/mule/ee/core"
xmlns:servicebus="http://www.mulesoft.org/schema/mule/servicebus"
	xmlns:http="http://www.mulesoft.org/schema/mule/http"
	xmlns="http://www.mulesoft.org/schema/mule/core"
	xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://www.mulesoft.org/schema/mule/core
	http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/http
http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/servicebus
http://www.mulesoft.org/schema/mule/servicebus/current/mule-servicebus.xsd
http://www.mulesoft.org/schema/mule/ee/core
http://www.mulesoft.org/schema/mule/ee/core/current/mule-ee.xsd">
	<configuration-properties file="mule-app.properties"
	doc:name="Configuration properties"/>
	<http:listener-config name="HTTP_Listener_config"
	doc:name="HTTP Listener config">
		<http:listener-connection host="0.0.0.0" port="8081" />
	</http:listener-config>
	<servicebus:config name="Microsoft_Service_Bus_Config"
	doc:name="Microsoft Service Bus Config">
		<servicebus:username-password-connection
		userName="${azure.keyname}"
		password="${azure.key}"
		namespace="${azure.namespace}" >
			<servicebus:caching-strategy >
				<servicebus:no-caching-configuration />
			</servicebus:caching-strategy>
		</servicebus:username-password-connection>
	</servicebus:config>
	<flow name="azure-service-bus-management-demoFlow">
		<http:listener doc:name="Topic Create Endpoint"
		config-ref="HTTP_Listener_config"
		path="/topic"/>
		<ee:transform doc:name="Set ServiceBusTopicDescription">
			<ee:message >
				<ee:set-payload ><![CDATA[%dw 2.0
output application/java
---
{
	defaultMessageTimeToLive: "P10675199DT2H48M5.4775807S",
	duplicateDetectionHistoryTimeWindow: "PT10M",
	enableBatchedOperations: false,
	maxSizeInMegabytes: 1024,
	requiresDuplicateDetection: false,
	sizeInBytes: null
} as Object {
	class : "com.mulesoft.connectors.microsoft.servicebus.extension.api.entity.ServiceBusTopicDescription"
}]]></ee:set-payload>
			</ee:message>
		</ee:transform>
		<servicebus:topic-create doc:name="Topic create"
		config-ref="Microsoft_Service_Bus_Config"
		topicPath="${topic.name}">
		</servicebus:topic-create>
		<ee:transform doc:name="Object to Json">
			<ee:message >
				<ee:set-payload ><![CDATA[%dw 2.0
output application/json
---
{
	author: payload.author,
	id: payload.id,
	title: payload.title
}]]></ee:set-payload>
			</ee:message>
		</ee:transform>
		<logger level="INFO" doc:name="Logger" message="#[payload]"/>
	</flow>
	<flow name="azure-service-bus-management-demoFlow1">
		<http:listener doc:name="Subscription Create Endpoint"
		config-ref="HTTP_Listener_config"
		path="/subscription"/>
		<ee:transform doc:name="Set ServiceBusSubscriptionDescription">
			<ee:message >
				<ee:set-payload ><![CDATA[%dw 2.0
output application/java
---
{
	lockDuration: "PT4M",
	requiresSession: false,
	deadLetteringOnMessageExpiration: false,
	deadLetteringOnFilterEvaluationExceptions: null,
	enableBatchedOperations: false,
	defaultMessageTimeToLive: "P10675199DT2H48M5.4775807S",
	maxDeliveryCount: null
} as Object {
	class : "com.mulesoft.connectors.microsoft.servicebus.extension.api.entity.ServiceBusSubscriptionDescription"
}]]></ee:set-payload>
			</ee:message>
		</ee:transform>
		<servicebus:subscription-create
		topicPath="${topic.name}"
		doc:name="Subscription create"
		config-ref="Microsoft_Service_Bus_Config"
		subscriptionPath="${subscription.name}"/>
		<ee:transform doc:name="Object to Json">
			<ee:message >
				<ee:set-payload ><![CDATA[%dw 2.0
output application/json
---
{
	linik: payload.link,
	id: payload.id,
	title: payload.title
}]]></ee:set-payload>
			</ee:message>
		</ee:transform>
		<logger level="INFO" doc:name="Logger" message="#[payload]"/>
	</flow>
	<flow name="azure-service-bus-management-demoFlow2">
		<http:listener doc:name="Rule Create Endpoint"
		config-ref="HTTP_Listener_config"
		path="/rule"/>
		<ee:transform doc:name="Set ServiceBusRuleDescription">
			<ee:message >
				<ee:set-payload ><![CDATA[%dw 2.0
output application/java
---
{
	action: {
		sqlExpression: "set MyProperty2 = 'ABC'",
		"type": "SqlRuleAction"
	},
	filter: {
		correlationId: null,
		sqlExpression: "property1 = 'ok'",
		"type": "SqlFilter"
	}
} as Object {
	class : "com.mulesoft.connectors.microsoft.servicebus.extension.api.entity.ServiceBusRuleDescription"
}]]></ee:set-payload>
			</ee:message>
		</ee:transform>
		<servicebus:rule-create topicPath="${topic.name}" doc:name="Rule create"
		config-ref="Microsoft_Service_Bus_Config" rulePath="${rule.name}"
		subscriptionPath="${subscription.name}"/>
		<ee:transform doc:name="Object to Json">
			<ee:message >
				<ee:set-payload ><![CDATA[%dw 2.0
output application/json
---
{
	link: payload.link,
	id: payload.id,
	title: payload.title
}]]></ee:set-payload>
			</ee:message>
		</ee:transform>
		<logger level="INFO" doc:name="Logger" message="#[payload]"/>
	</flow>
</mule>