Hi @tomschreck ,
TL;DR - yes, the Solace Event Broker can handle command, events, messages, REST interactions and a lot more.
Detailed answer:
I think it’s worth talking at a more architectural level for this question. Let me start by answering some questions of my own:
Can I exchange messages using pub/sub? Yes. You can exchange any message using the pub/sub pattern. Can I exchange commands using pub/sub? Yes. Any pub/sub system can route commands - commands can be a specialisation of messages. However, commands benefit from some features at the pub/sub layer (see below) Can I exchange events using pub/sub? Yes. Events are a specialisation of messages. How does Solace PubSub+ treat messages, commands and events differently? It doesn’t. PubSub+ doesn’t care about the content (payload) of the message/command/event.
So how do we differentiate between them?
We use a topic taxonomy to tag events with topics that will exchange events. The same taxonomy can have a taxon in the tree that exhanges commands. We interpret the payload differently. We do this by using topic routing to route events to event consumers, and commands to command consumers. We can configure certain aspects of the exchange pattern to make command processing easier. Here is my recommended pattern for commands in PubSub+:
Send the command to a topic ; Tag the command as request/reply. A command expects a reply. Whether this is synchronous (has a timeout) or not is up to you. You’ll probably want to use a correlation ID, especially if you’re using an asynchronous pattern, and this helps with idempotency; Map the command topic to a queue . Your command handler will consume from this queue. Set the max consumer count on the queue to 1. This prevents any other consumers from binding to the queue. Set the queue permissions so that only your command handler is permitted to bind. This gives you your ability to limit who can respond to the command.