Solace Essentials Activity Guide
Solace Essentials Activity Guide
This activity guide accompanies the Solace Essentials online course available on Solace
Academy.
© Solace Corporation.
http://www.solace.com
Solace Essentials – Activity Guide
Table of Contents
EXERCISE 1: PUBSUB+ CLOUD ACCOUNT ................................................................................................................3
EXPORTING DOMAIN............................................................................................................................................... 21
2
Solace Essentials – Activity Guide
IMPORTANT NOTE: You can perform all hands-on activity using either the Trial or Enterprise accounts.
2. Enter the details requested on the form and click Sign Up.
You are a smart architect and know there is a tool out there called the Event Portal, through which you can mock up
your designs and choreograph the event flow between applications in just a few hours, giving you rest of the week to
binge watch your favourite show.
You get to work and use the below steps to complete the design:
1. You document the events, which applications will need to produce or consume
2. You add the schema to those events, so developers know what payload to add when producing or consuming
events
3. You map the events to the applications and create a visual graph of the event flows
3
Solace Essentials – Activity Guide
4. But to impress your company you take it a step further and generate the plumbing code for the applications
that produce and consume your designed events.
4
Solace Essentials – Activity Guide
You have now created your application domain and can start adding events, schemas, and applications to your design.
5
Solace Essentials – Activity Guide
Creating an Event
1. Select the Event button from the Designer Toolkit within your application domain
• Name: <YOUR_NAME>RideRequested
• Description: This is the event that is fired when a customer has confirmed they want a ride.
3. Create a new Logical Event Mesh (LEM): <YOUR_NAME>RideshareLEM using the Add link. NOTE: you only
have to do this once and for all future events in our domain we will select the newly create LEM.
6
Solace Essentials – Activity Guide
4. Select Set Topic Address, to set the topic on which this event will be published on.
<YOUR_NAME>/rideshare/ride/requested/2.0.1/{start_latitude}/{start_longitude}/js
on/{customer_id}/{request_id}
• NOTE: The <YOUR_NAME>/rideshare is your Topic Domain set when creating the Application
Domain. You can use the Auto Create These Levels link on the Tip screen to add the Topic Domain.
• Remember: Levels in a topic in Solace are separated by a “/” character. In the above example, ride is
a level and requested is another level. Each of these levels much be created to set the Topic Address.
• Next, select the Create level button to construct the remain part of our topic mentioned above:
• NOTE: A literal value is a fixed part of our topic that does not change for the event. Variables are
values that can dynamically change for the same event. In our case the Longitude & Latitude are
value that change dynamically for this event and will be set as variable.
• NOTE: in our topic mentioned above anything within the “{}” brackets is a Variable. When entering
the string you can exclude the “{}” which will be set when the type Variable is selected.
5. Once all the Topic levels have been created click the Set and Return to Event button.
7
Solace Essentials – Activity Guide
6. Next add Schema for the event using the Add link for the Value field.
• Name: <YOUR_NAME>RideRequested
• Description: The Ride Request schema allows a user to define the ride that is to be requested.
• Optional: you can optionally set yourself or another team member as the owner of the Schema as
well as set Tags to allow for easier searching and filtering of the schema.
• Content: copy and paste the contents of the RideRequested.json file or use the import button to
import the schema from the file.
i. NOTE: schema files are available along with the course online on Solace Academy.
8
Solace Essentials – Activity Guide
Create an application
1. Select the Application button
9
Solace Essentials – Activity Guide
10
Solace Essentials – Activity Guide
o Topic: use the Set Topic Address to set the below topic. NOTE: you can select any levels we
created before by selecting it (as shown below), instead of creating the level again.
<YOUR_NAME>/rideshare/ride/accepted/2.0.5/{location}/json/{customer_id}/{request
_id}/{driver}
11
Solace Essentials – Activity Guide
5. Select Add New to add a new schema to the event and enter the following:
o Name: <YOUR_NAME>DriverRideAccept
o Description: Data format that represents the information required for a driver to accept a ride.
o Content Type: JSON
o Content: copy and paste the contents of the DriverRideAccept.json file or use the import button to
import the schema from the file.
7. Select the Sub button for the RideAccepted and Pub button for RideRequested events. Verify the events
appear in the Events Published and Subscribed list, and then select Save.
You have now created an application at design time and associated the events to that application.
12
Solace Essentials – Activity Guide
1. Select the Passenger App icon from your Application Domain workspace and select the 3 dots from the
Application overview panel.
3. Select your either JSON or YAML file format and click Download button. This will download a AsyncAPI
schema file for your application to your local computer.
13
Solace Essentials – Activity Guide
1. Select the Event Catalog from the PubSub+ Cloud Console menu
2. Search for all events beginning with your name or search by your Application Domain, select the
<YOUR_NAME>RideRequested event from the search result, and then select Add to Application.
b. Description: This application controls which rides need to be fulfilled, which are in route, and
completed
14
Solace Essentials – Activity Guide
6. Select the event this new application is going to subscribe to and click Next. Note, on the window that follows
after, you want to ensure the event is not selected as this application will not be publishing that event and
only consumes it.
8. Once the application has been created, select the Event Designer from the menu, and open your Application
Domain to view the visual representation of the Driver Management application and its linkage to the
RideRequested event.
15
Solace Essentials – Activity Guide
NOTE: For the remaining exercises, details are provided on the events, schema, and applications you need to create,
without the step-by-step instructions.
16
Solace Essentials – Activity Guide
Event: DriverRideAccepted
Name <YOUR_NAME>DriverRideAccepted
Description This is the application that a driver uses to interact with the Acme Rideshare ecosystem.
Topic <YOUR_NAME>/rideshare/driver/accepted/2.0.5/{location}/json/{customer_id}/{request_i
d}/{driver}
Shared No
Schema Name <YOUR_NAME>DriverRideAccept (NOTE: This schema was already created in previous
exercises, so you should reuse that schema)
Schema Description NA
Schema Format NA
Event: DriverStatusUpdated
Name <YOUR_NAME>DriverStatusUpdated
Description When a driver status changes, this event is generated to notify up status changes.
Topic <YOUR_NAME>/rideshare/driver/status/updated/1.0.2/{driver_id}/{activation_status}
Shared No
Schema Description Schema represents the data format that the driver apps should be sending periodically
that represent the "state" of the driver.
Event: TripUpdated
Name <YOUR_NAME>TripUpdated
Description This is the event which is fired periodically when a driver is on an active trip.
Topic <YOUR_NAME>/rideshare/trip/updated/7.0.2/json/{driver_id}/{trip_id}/{status}
17
Solace Essentials – Activity Guide
Shared Yes
Event: DriverFundsDeposited
Name <YOUR_NAME>DriverFundsDeposited
Description This event is triggered after billing has successfully deposited money into a drivers account
Topic <YOUR_NAME>/rideshare/driver/funds/deposited/1.0.1/{driver_id}/{trip_id}/{payment_id}
Shared No
Schema Description This Schema represents the data needed to inform drivers about being paid for a given ride
and the payment breakdown
Event: CustomerReceiptGenerated
Name <YOUR_NAME>CustomerReceiptGenerated
Description This is the event which contains a customers receipt information once payment has gone
though
Topic <YOUR_NAME>/rideshare/billing/receipt/created/1.0.1/json/{request_id}
Shared No
Schema Description This Schema conforms to the format of a customer receipt and should only be used when
providing receipts to end customers.
Event: DriverRideRequested
Name <YOUR_NAME>DriverRideRequested
18
Solace Essentials – Activity Guide
Description This is the event triggered to active drivers that are within a geospatial proximity to the
passenger
Topic <YOUR_NAME>/rideshare/driver/requested/3.8.1/{start_latitude}/{start_longitude}/json/{
customer_id}/{request_id}
Shared No
Schema Name <YOUR_NAME>RideRequest (NOTE: This schema was already created in previous exercises,
so you should reuse that schema)
Schema Description NA
Schema Format NA
Description This is the app that a user of acme rideshare uses in order to obtain rides from willing
drivers.
<YOUR_NAME>RideAccepted
Description This is the application that a driver uses to interact with the Acme Rideshare ecosystem.
<YOUR_NAME>DriverStatusUpdated
<YOUR_NAME>TripUpdated
<YOUR_NAME>DriverRideRequested
19
Solace Essentials – Activity Guide
Description This app processes customer payments and also pays the drivers.
<YOUR_NAME>DriverFundsDeposited
Description This application controls which rides need to be fulfilled, which are in route, and
completed
<YOUR_NAME>RideAccepted
<YOUR_NAME>DriverStatusUpdated
<YOUR_NAME>RideRequested
<YOUR_NAME>TripUpdated
20
Solace Essentials – Activity Guide
Exporting Domain
In this exercise you will export your domain to a JSON file. This allows you to backup your domain and/or recreate the
domain in another org account.
1. Go to your domain and select the 3 dots from the overview panel.
2. Select Export from the menu options, and then select Continue when prompted.
You have now completed all activities part of the PubSub+ Event Portal module.
1. From the home page of PubSub+ Cloud Console select Cluster Manager:
21
Solace Essentials – Activity Guide
2. From the Services pages select the “+” button or Create Service button.
4. Select a cloud from the dropdown box. Choose between either Amazon Web Services/Google Cloud
Platform/Microsoft Azure.
22
Solace Essentials – Activity Guide
6. Give your service a name: Solace Essentials Training and select Start Service.
23
Solace Essentials – Activity Guide
7. Your service will be created. This may take 5-10 mins to deploy.
8. Once the service is created you can click on the Try Me tab to test your service.
You have now successfully deployed a PubSub+ messaging service in a public cloud. We will be using this service for
some of the other activities in this guide.
24
Solace Essentials – Activity Guide
Note: you deploy the free standard edition on another environment like VirtualBox if Docker is not available or you are
unable to install Docker on your desktop.
1. From a command-line terminal copy and paste the following Docker command:
This command starts a message broker container named solace, using the latest PubSub+ Standard image
pulled from Docker Hub, creates an admin user with global access permissions, and publishes the following
message broker container ports to the same ports on your host machine:
• port 8080 — Use this port when configuring the message broker container with Solace PubSub+
Manager.
• port 55555 — Your applications can use Solace APIs to connect to the message broker on this port.
• port 80 — The JavaScript sample applications below use this port to pass Web Messaging traffic
through the message broker.
• ports 1883 & 8000 — Ports for MQTT connectivity, over TCP and over WebSockets respectively
• port 5672 — AMQP 1.0 applications using Apache QPID APIs would connect here
• port 9000 — Use REST to send messaging and event data with Solace’s RESTful API port
• port 2222 — Use SSH to connect to the Solace Command Line Interface (CLI) for advanced
configuration
docker ps
25
Solace Essentials – Activity Guide
3. Open the following webpage to run the Publisher and Subscriber samples:
https://solace.com/products/event-broker/software/getting-started/
6. Once the subscription has been added, select the Publish button and verify you can receive messages on the
subscriber.
7. Experiment with different topics and topic subscription. For more information on Topics refer to the Topics
and Wildcard lesson part of the Introduction module in the online course.
You have now successfully deployed a PubSub+ Software Event Broker on Docker for Desktop and completed all
activities part of the Event Broker module. We will be using this service for some of the other activities in this guide.
26
Solace Essentials – Activity Guide
http://127.0.0.1:8080/
27
Solace Essentials – Activity Guide
1. Logon to your PubSub+ Cloud Console and select Cluster Manager to view your services created in earlier
exercise: https://console.solace.cloud/services
3. From the Manage tab select Queues (you can optionally select Manage Service button at the top right corner,
and then when PubSub+ Manager opens select Queues from the menu options).
28
Solace Essentials – Activity Guide
4. Click on the create Queue icon, and give you queue the following name:
7. To test your queue, lets publish & consume some messages using the queue.
9. Connect the sample Publisher, and select Queue, enter your queue name <YOUR_FIRSTNAME>_q1, select
the delivery mode as Persistent, and Publish a few messages.
29
Solace Essentials – Activity Guide
10. NOTE: we have not yet connected the subscriber so our messages should be queued up and we can verify
this from the Queues page.
11. Connect your sample Subscriber, select Bind to an endpoint to receive guaranteed messages, select Queue,
enter your queue name, and select Start Consume.
12. Verify you have received the messages. You can also go back to the actual queue to verify the messages have
been consumed and acknowledged.
You have now created a queue and tested it by sending and receiving messages using the Try Me feature.
1. From the previous exercise, access the PubSub+ Manager for your cloud service, and select the queue you
had created (<YOUR_FIRSTNAME>_q1)
30
Solace Essentials – Activity Guide
6. Create another queue <YOUR_FIRSTNAME>_q2 and repeat the above steps to add the same topic
subscription to this second queue.
7. Now test Publish-Subscribe exchange using the Try Me tab. Note this time publish message to the topic
solace/essentials/training instead of publishing to the queue directly.
31
Solace Essentials – Activity Guide
You have now completed mapping topics to queues activity and demonstrated how to perform publish-subscribe
using guaranteed messaging and queues.
For this activity we will use Postman utility, but you can also use other similar tools or command-line based tools like
cURL.
1. Open Postman.
2. In the Activity Guide.zip downloaded locate the SEMP Postman Collection folder and import the Solace
Essentials Training.postman_environment.json in Postman environment
3. Edit the imported environment and update the current value for FirstName to your first name.
32
Solace Essentials – Activity Guide
33
Solace Essentials – Activity Guide
a. NOTE #1 the scripts assume you are using the local PubSub+ Software broker deployed on Docker. If
you broker is running on another machine with a different IP, and the URL should be adjusted
accordingly.
b. NOTE #2 the scripts also assume your Message-VPN is named as <YOUR_FIRSTNAME>_vpn. If you
named you VPN differently, then this will need to be adjusted in the URL as well.
9. Similarly, run the Create Queue and Update Queue SEMP requests.
You have now completed the SEMP activity using Postman. Additional SEMP requests and documentation can be
found here: https://docs.solace.com/SEMP/Using-SEMP.htm
In this activity we will run the CLI on the Software broker deployed on Docker. For accessing CLI for other deployments
refer to the documentation here: https://docs.solace.com/Solace-CLI/Using-Solace-CLI.htm
1. Open command-line terminal window and verify your PubSub+ docker container is running
docker ps
2. Next enter the following Docker command to open a CLI session to the broker:
34
Solace Essentials – Activity Guide
4. Enter the following command to view a list of all Message-VPNs on your broker.
show message-vpn *
5. Enter the following command to edit a queue configuration, say updating the Max Msg Spool Usage
(assuming you had created a VPN from the previous exercises with the format <YOUR_FIRSTNAME>_vpn).
enable
config
message-spool message-vpn <YOUR_FIRSTNAME>_vpn
queue <YOUR_FIRSTNAME>_q1 (Or the name of the queue you have on this broker; to
create a new queue using CLI using the create queue <name> command)
max-spool-usage 300
6. Run the following command to verify your changes:
You have now completed the CLI activity. You can explore more commands and operations from the Solace
documentation or using the help command on the CLI.
1. Enter the following Docker command to open access the host docker container itself:
cd /usr/sw/jail/logs/
35
Solace Essentials – Activity Guide
4. Use vi to view the event.log and system.log file. Perform basic search operations to find events you are
interested in. For ex. locate the CLIENT_CLIENT_CONNECT & CLIENT_CLIENT_DISCONNECT events for the Try
Me Publisher and Subscribe we connected in the previous exercises. You can also use Linux greg and other
tools to search for text within these log files.
5. To access these events from the CLI, either type cli on the command line or open a CLI session as done in the
previous exercise.
6. Enter the following command to view for example the event.log file and search for the
CLIENT_CLIENT_DISCONNECT events:
36
Solace Essentials – Activity Guide
NOTE: There are two different ways to generate diagnostics files for docker-based containers. The first approach is to
extract the utility from the docker container and run from a Linux-based host machine with Python 2.7 or above
installed. The 2nd approach is when you are using Docker for Windows or Docker for Mac and generate a sidecar
container to run the utility from.
We will use the 2nd approach in this exercise and assuming you are running your PubSub+ event broker on Docker for
Mac. If you are using Docker for Windows, and running it another docker runtime environment, then refer to the
documentation for complete instructions.
2. To use this utility in Docker for Mac, create a new sidecar container with privileged settings based on the
software event broker Docker image with a different ENTRYPOINT command (gather-diagnostics-host)..
NOTE: update the highlight text below to output the file to your specified directory, and PubSub+ version.
3. This file copied to the folder you specified above can then be provided to Solace support team when raising a
ticket by uploading it to https://filedrop.solace.com
1. Event-Driven Microservices
2. Hybrid-Cloud
4. Solace Community
5. Developer CodeLabs
GitHub Resources
Solace Products
Repositories containing open source Solace Products. Here you'll find quick-start code to help you configure the
PubSub+ Event Broker with Kubernetes,VMware Tanzu, OpenShift, Spring Boot, AWS, Azure, and more.
37
Solace Essentials – Activity Guide
Solace Labs
Includes reference demos, examples, integration guides, and more, created by the Solace Community.
Solace Samples
Solace developer samples that show you how to get started using PubSub+ Event Broker with many of the Solace
Messaging APIs and protocols.
38