Publish Message TO Anypoint MQ

 

In this tutorial we will demonstrate how can we publish the message to Anypoint MQ

The Anypoint MQ connector provides publish-subscribe messaging to Mule apps using the Anypoint MQ cloud service.

Anypoint MQ supports a wide range of messaging use cases, such as enterprise messaging patterns, asynchronous communications between microservices, and IoT. Anypoint MQ also has a REST API for publishing or consuming messages using frameworks such as node.js, Java, Go, and DevOps bash scripts.

The Publish operation enables you to create a new Anypoint MQ message and send it to the specified destination: queue, FIFO queue, or message exchange. With it, you can configure both the content of the message and all the headers and properties you need.

To use this connector, you should be familiar with Anypoint Studio, Anypoint Connectors, and application flows. The Anypoint MQ connector is free, but connecting to the service in Anypoint Platform requires a license.

Drag and drop HTTP listener to trigger the request

Let’s create a mule service which accept input as JSON

 

Add Byte Array to String to convert the JSON request in readable format

configure the MQ connection

Follow the below steps to configure the connection:

  • Drag the name of the operation from the Mule Palette to the canvas, and then select it.
  • Click the green plus sign to the right of Connector configuration.
  • In Anypoint Platform, click MQ > Destinations.
  • Copy the URL for your region to the URL field in Studio.
  • In Anypoint Platform, click MQ > Client Apps.
  • If needed, create a client app.
  • Copy the Client App ID value from Anypoint Platform to the Client App ID field in Studio.
  • Copy the Client Secret value from Anypoint Platform to the Client Secret field in Studio.
  • Click Test Connection to verify the Anypoint MQ Default subscriber.
  • Click OK.

Publish Message TO Anypoint MQ

 

Publish Message TO Anypoint MQ

 

Where Destination will be the MQ name and Message ID will be any unique identifier for the message

Test the mule application from soapUI

 

Message is successfully enqueue to Anypoint MQ

Goto MQ configuration in Anypoint platform

Click on Message Browser and now we can see the message on MQ

  
Thank you for taking out time to read the above post. Hope you found it useful. In case of any questions, feel free to comment below. Also, if you are keen on knowing about a specific topic, happy to explore your recommendations as well.
 
For any latest updates or posts on our website, you can follow us on LinkedIn. Look forward to connecting with you there.


Share this:
Subscribe
Notify of
guest
2 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Harry
Harry
6 years ago

how to configure in Soap UI.Any help would be much appreciated.