9. Solace Queues
• A queue
– Is a destination that clients can publish to
– Is an endpoint that clients can bind
consumers to and consume messages from
– Can subscribe to topics
• Although many consumers can
bind to a queue, an individual
message spooled on the queue
can only be consumed by a single
consumer
Consumer 1
Producer
Queue: Q1
Consumer 2
Queue: Q2
Topic Subscription:
EQ/*/FB
Topic Subscription:
EQ/>
EQ/NASDAQ/FB
12. What is Replay? What is Replay? What is Replay?
• Powerful feature which allows consumers to receive messages hours or days after their original delivery
• Replay from a specific time, or from the beginning of the replay log
– Can be initiated by client applications or administrators
• Messages are kept until the log is full, after which the oldest messages are removed to free-up space for
new messages.
13. Message Replay
• Wildcard topic filtering
• Messages are only replayed to the queue for which replay is requested
Client Application requests
messages are replayed to Q3
Q1
Replay Log
Q2
Q3
15. Demo Overview
• Goal is to control car movement using Arduino
chip and PubSub+ broker
• We will send JSON messages via PubSub+ to
control the car
• Show Replay in action by ‘replaying’ car’s
movement
• Cross our fingers and hope all works well.
16. What you need for this demo
• Arduino car kit (Amazon)
• Soldering iron (Amazon)
• An MQTT broker (Solace PubSub+)
• Code (github)
• Arduino IDE (download) to upload
the code to chip
17. Arduino Chip and Code
// Subscription logic
boolean mqttReconnect() {
Serial.println("Connecting to MQTT...");
char mqttClientId[40];
sprintf(mqttClientId, "ESP8266Client%lu", chipId);
if (client.connect(mqttClientId, mqttUser, mqttPassword, NULL, NULL, NULL, NULL, false ))
{
Serial.println("connected");
// Subscribe to global drive commands
client.subscribe("car/drive");
client.subscribe("car/mode");
client.subscribe("car/light");
// Subscribe to car specific drive commands
char carDriveTopic[40];
sprintf(carDriveTopic, "car/drive/%lu", chipId);
client.subscribe(carDriveTopic, 1);
// Wifi details
const char* ssid = "<ssid>";
const char* password = "<ssid_pwd>";
// MQTT broker
const char* mqttServer = "<broker-host>";
const int mqttPort = 1883;
const char* mqttUser = "<username>";
const char* mqttPassword = "<password>";