Author: Rakesh Parte
Solace PubSub+ is a message broker (managed messaging as a service – MaaS) that can run on any computer in a VM or a container. Here, we will explain how to configure the Solace PubSub+ Connector in MuleSoft to send or receive events/messages via Solace topics. This approach will help implement an Event-Driven Architecture (EDA).
1. Access of Solace PubSub+ Event Broker.
2. MuleSoft Anypoint platform Account and Anypoint Studio.
A. MuleSoft Anypoint Account is required to download solace connector dependency from Anypoint exchange.
Steps to follow:
- Create account in Solace (https://console.solace.cloud/login).
- Click on ‘Cluster Manager’ .
- Create a new service. Simply click on any of the buttons highlighted below.
- Enter all the required information for the messaging service, after that click on ‘Create Service”.
In this case, I have selected Amazon Web Services.
- Your service should be ready and can see service details as below.
- Create a new MuleSoft project “solace-connector”.
- Add dependency “Solace PubSub +Connector” as below.
- Select the Solace messaging service and get below parameter’s value from the Connect tab.
- Message VPN
- Secured SMF Host
- In the Connection tab of the Connector, enter the details copied from Step 8. Click on “Test Connection” to check the connectivity with the broker.
- Drag and drop the Direct Topic Subscriber and Publish Palette (Solace PubSub+ Connector).
With the above design, we will publish a sample message on the topic ‘mule-message,’ and from the same topic, we will subscribe to a message using the Direct Topic Subscriber palette.
- Run the project and invoke listeners to send sample messages to the topic.
We can see the published message received from the topic ‘mule-message’ using the Direct Topic Subscriber pallet.
The same message will be received from Solace if you are subscribing to the topic ‘mule-message’.