Computer Science, asked by abidanaveed509, 1 year ago

Write a mule flow to connect windows azure service bus queue or topic or blob storage

Answers

Answered by singhmahesh140
2
Microsoft Azure is a cloud- based data-storage infrastructure that is accessible to the user programmatically via a MuleSoft 'Microsoft Service Bus' connector.
Answered by iamtouseif
0
This connector supports the communication with queues, topics, and EventHubs through AMQP 1.0.

Features of Service Bus Connector

Send messages to queues, topics, and EventHubs with the support of AMQP.

Receive from queues and topic asynchronously.

Supports Windows Service Bus on-premise as well as Azure Service Bus on the cloud.

Rest management API like CRUD for queues, topics, subscriptions, and rules.

First, go through my article on how to create a service bus with Windows Azure. This article will give you a brief idea on how to create queues and topics in Azure cloud.

Now, we will walk through how to send and receive messages from the Windows Azure Service Bus queue.

Send Messages to the Windows Azure Service Bus Queue

Place the HTTP listener into the canvas and click to open the Properties console.

Click the green + and configure as follows:

Host: localhost.

Port: 8081.

Method: POST.

Path: servicebus.

Search and drag the Microsoft Service Bus Connector into the canvas. If the Microsoft Service Bus Connector is not found, then install it from Anypoint Exchange.

Click on the green + to configure the Microsoft Service Bus Connector.


Select Microsoft Service Bus: Azure Service Bus.

Provide Service Name, Shared Access Key Name, and Shared Access Key. Then, you can get it from the Windows Azure Service Bus connection information.

Perform the test connection and press OK.

Select Operation Queue send and provide the destination queue name.


Test the Application

You can use Postman to send the request to Mule flow and Mule flow will send a message to the Azure Service Bus queue. The URL is http://localhost:8081/servicebus.

You can verify in the Azure Service Bus queue whether the message was received.


Code:

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

<mule

xmlns:http="http://www.mulesoft.org/schema/mule/http"

xmlns:microsoftservicebus="http://www.mulesoft.org/schema/mule/microsoftservicebus"

xmlns="http://www.mulesoft.org/schema/mule/core"

xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"

xmlns:spring="http://www.springframework.org/schema/beans"

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd

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/microsoftservicebus http://www.mulesoft.org/schema/mule/microsoftservicebus/current/mule-microsoftservicebus.xsd">

<microsoftservicebus:azureConfig name="Microsoft_Service_Bus__Azure_Service_Bus" namespace="" userName="" password="" doc:name="Microsoft Service Bus: Azure Service Bus"/>

<http:listener-config name="HTTP_Listener_Configuration" host="0.0.0.0" port="8081" doc:name="HTTP Listener Configuration"/>

<flow name="servicebusflowFlow">

<http:listener config-ref="HTTP_Listener_Configuration" path="/servicebus" allowedMethods="POST" doc:name="HTTP"/>

<microsoftservicebus:queue-send config-ref="Microsoft_Service_Bus__Azure_Service_Bus" destinationQueue="muletestqueue" doc:name="Microsoft Service Bus"/>

<set-payload value="Message Sent to Queue" doc:name="Set Payload"/>

</flow>

</mule>



hope it helped you mark this a brainleist

Similar questions