This codelab will lay the groundwork for a Solace based Event Mesh by setting up a Dynamic Message Routing (DMR) link between two stand alone brokers. These brokers can be running in Docker or on Solace Cloud, in any cloud environment. Then we will explore how events are propagated across a DMR link. Setup publishers and Subscribers to each of the brokers in our Event Mesh in order to see events publish to one broker be dynamically routed to the other brokers in our Event Mesh where there are active subscribers.
⬜️ Setup a DMR link between two Solace Brokers
⬜️ Publish and Subscribe to DMR enabled topics with Try Me
⬜️ Publish and Subscribe to DMR enabled topics with SDKPerf
If you do not meet both of these requirements please use the following resources to setup and configure Solace PubSub+ Brokers.
What is a Solace Event Mesh Powered by DMR
If you have not heard about Solace Dynamic Message Routing (DMR) or Event Mesh here is a quick refresher: An event mesh is like a super-efficient highway system for data that allows event data to flow only to parts of the mesh where that event is needed. This occurs dynamically, meaning that new event types can be added any time, and new interests in events can also be registered, immediately changing the flow of events in real time. Event Brokers that make up the mesh can be running in any environment (data center, private cloud, public cloud, or combination), and are configured to dynamically route data from producing applications to consuming applications without forcing those applications to know about one another, or how they connect to the mesh.
Select Cluster from the left Solace menu then select Create New Cluster
In the previous steps we have provisioned a cluster on each broker to prepare them to participate in an Event Mesh. Then we created a DMR link between the brokers to form the Event Mesh. Events will now be intelligently and Dynamically Routed from the Solace PubSub+ brokers where they are produced to the broker where there are interested subscribers. Continue to learn how we can explore the behavior of events over a DMR Link.
The Solace Try Me Tab is small CodePen application which was created to provide a simple way of publishing and subscribing to Solace topics and queues. The application produces and consumes WebSocket (WS) events to Solace PubSub+ brokers over a network. Thus is it not required that the Try Me tool be used to connect to a local broker, however the tooling is setup to make connecting to the "local" Solace Broker effortless. Using the Try Me tool you can explore the following Solace features:
In the next section we will explore how using the Try Me tool to Publish and Subscribe only to a single individual Solace Broker will allow us to obtain events from any accessible topic published to any of the Solace Brokers connected to our Solace DMR Event Mesh.
The Solace Try Me Tab is small CodePen application which was created to provide a simple way of publishing and subscribing to Solace topics and queues. The application produces and consumes WebSocket (WS) events to Solace PubSub+ brokers over a network. Thus is it not required that the Try Me tool be used to connect to a local broker, however the tooling is setup to make connecting to the "local" Solace Broker effortless. Using the Try Me tool you can explore the following Solace features:
In the next section we will explore how using the Try Me tool to Publish and Subscribe only to a single individual Solace Broker will allow us to obtain events from any accessible topic published to any of the Solace Brokers connected to our Solace DMR Event Mesh.
🆘!!!Maybe here I should include some topic architecture for 2 brokers that will allow you to see the DMR Event Mesh in action?
Option A: For your local (on-premise) broker
* is a single level wild card: example/topic/with/a/*/wildcard
> is a multi level wild card: example/topic/>
Option B: For your Solace Cloud Brokers
* is a single level wild card: sample/topic/with/a/*/wildcard
> is a multi level wild card: sample/topic/>
Now that we have created publishers and subscribers via the "Try Me" tabs on our different DMR linked (Event Mesh) brokers we can start publishing events and watch them flow between brokers. Experiment with "Try Me" subscriptions to only local topics, remote topics and combinations of both to get a better understanding of how Solace is Dynamically Routing messages between brokers.
Obtain the SDKPerf Solace Performance testing tool from our downloads page here: https://solace.com/downloads/ at the bottom of the page. You can select from your desired flavor or the testing tool.
Check out general SDKPerf documentation here: https://docs.solace.com/API/SDKPerf/SDKPerf.htm
And additional command line argument options here: https://docs.solace.com/API/SDKPerf/Command-Line-Options.htm
Navigate to the unpacked directory of your recently downloaded SDKPerf tool in the terminal of your choice. When you list the contents of the directory you should see some libraries and in the case of the java tool: sdkperf_java.sh
and sdkperf_java.bat
. We will use these scripts to execute the tool.
List of common SDKPerf flags
-cip= <- the ip address(host name) and port of the broker we wish to connect to
-cu= <- userid and message vpn we wish to connect as seperated by @
-cp= <- password for the user we are connecting as
-ptl= <- publish topic list, the topics we want to publish to separeated by ,
-stl= <- list of topics we want to subscribe to separated by a ,
-mn= <- integer for the number of messages we want to publish
-mr= <- integer for the rate at which we want to publish or subscribe in msg/sec
sample/broker/a
./sdkperf_java.sh -cip=localhost:55554 -cu=admin@default -cp=admin -ptl=sample/broker/a -mn=100 -mr=1
sample/broker/b
./sdkperf_java.sh -cip=mr-6d275srp5ae.messaging.solace.cloud:55555 -cu=solace-cloud-client@jamiesontest -cp=vkkveu1ublk5ekl4mffh7uvmf -ptl=sample/broker/b -mn=100 -mr=1
sample/broker/b
./sdkperf_java.sh -cip=localhost:55554 -cu=admin@default -cp=admin -stl=sample/broker/b
sample/broker/a
./sdkperf_java.sh -cip=mr-6d275srp5ae.messaging.solace.cloud:55555 -cu=solace-cloud-client@jamiesontest -cp=vkkveu1ublk5ekl4mffh7uvmf -stl=sample/broker/a
✅ Setup a DMR link between two Solace Brokers
✅ Publish and Subscribe to DMR enabled topics with Try Me
✅ Publish and Subscribe to DMR enabled topics with SDKPerf
We prepared Solace PubSub+ Event Brokers to participate in an Event Mesh by provisioning a cluster on each broker. Then we connected those brokers together with DMR Links to create an Event Mesh. After creating our Event Mesh we explored two different ways of easily publishing and subscribing to Solace topics. Using these two methods and Solace Brokers that are connected into a DMR Event Mesh you can create a suite of publishers and subscribers on each broker in the Event Mesh. By experimenting with the topics each subscriber SDKPerf tool or "Try Me" tool is advertising a subscription to you can see how events are dynamically routed between brokers that are DMR linked.
As a final note you can also cause a broker in the DMR Event Mesh to have advertise a topic subscription by creating a queue on the broker and subscribing to a topic that is being published to a different broker in the DMR Event Mesh. But keep in mind that the subscriptions in these queues will be a more static subscription so unless you delete the queue or its subscription the events will always be passed to that broker to be stored on the queue.
Thanks for participating in this codelab! Let us know what you thought in the Solace Community Forum! If you found any issues along the way we'd appreciate it if you'd raise them by clicking the Report a mistake button at the bottom left of this codelab.