Updated: Apr 13
Github repository with the Mule Project can be found at the end of the post.
In this article, I will demonstrate how to integrate Solace PubSub+ with MuleSoft to publish and consume the messages.
What is PubSub+?
PubSub+ is a platform that enables the design, discovery, streaming and full lifecycle management of events across distributed enterprises. It provides all of the tools necessary to support a modern event-driven architecture. The main components of the platform are PubSub+ Event Brokers, PubSub+ Event Portal and PubSub+ Cloud Console.
More information in the PubSub+ for Developers website.
Advantages and Disadvantages of Event-Driven Approach
More careful design required
More thought goes in design and tracking
Now let us see the steps involved in Integrating Solace and MuleSoft.
1. Creating a Solace Cloud Trial Account
You can create a Free Solace trial account using the following link: https://console.solace.cloud/login
Click on “Sign Up” and fill in all the details. You will receive a welcome email in your inbox. Now you will be able to sign in with your credentials in the login page.
2. Creating the Messaging Service
Once you login with your credentials, you will see a welcome screen like the following one.
Now click on “Cluster Manager,” located at the left side of the screen to create a Service.
According to the official Solace documentation for Managing Services - Solace PubSub+ event brokers support the following Services:
Solace Message Format (SMF)—This Service allows clients to communicate with an event broker on the Message Backbone interface.
Solace Element Management Protocol (SEMP)—This Service allows management applications to communicate with an event broker on the Management interface.
Web transport—This Service allows Web clients to communicate with an event broker.
Solace Representational State Transfer (REST)—This Service allows REST clients to communicate with an event broker using standard HTTP requests.
Message Queuing Telemetry Transport (MQTT)—This Service allows clients to communicate with an event broker using the MQTT messaging protocol.
Advanced Message Queuing Protocol (AMQP)—This Service allows AMQP clients to communicate with an event broker using the AMQP open standard application layer protocol.
Let us spin up a Service.
First select the Service Type you want to use. There are two types of Services:
Enterprise: A highly available Service on dedicated infrastructure with customizable connections
Developer: A Service on dedicated infrastructure with 100 connections.
In this case, I have selected “Developer.”
Then, select the Cloud. In my case, I chose “Amazon Web Services,” or “AWS” for short. As you can see from the following screenshot, there are different clouds that you can choose from. Select any cloud depending on your need.
Select the Region. In my case, I chose “US East (N. Virginia)” because it’s closer to me.
Give the Service a name. A good naming convention is to create it using the Cloud and the Environment name, like “sol-aws-dev.” You can check with your team if there are any standards to name the Messaging Services.
After that, select the Message VPN name and start the Service by clicking “Start Service.”
Your Service should now be up and running.
3. Configuring the Solace KeyStore in MuleSoft
Once we have a Messaging Service, we’ll need to configure the KeyStore in MuleSoft in order to connect to the Service.
Click on the Messaging Service to open the Services’ settings.
Once inside, click on the “Connect” tab, located at the top of the screen, and select the protocol you want to use to connect the Service. In our POC, we use the “Solace Messaging” option.
After you select the protocol, you will see all the Connection Details, which will be used in MuleSoft (JMS Config) in order to connect to Solace.
As you can see from the screenshot above, you can download the TrustStore certificate by clicking on the “Download PEM” link.