One of the most frequent questions customers ask me is “What is the difference between a queue vs. a topic endpoint?”. While both queues and topic endpoints persist messages, it’s important to understand what they are, how they’re different, and when each one should be used.
Solace endpoints are objects created on the event broker to persist messages. There are two types of endpoints: queue endpoints (usually just called queues) and topic endpoints.
Before we talk about queues vs. topic endpoints, it’s important to note that a topic endpoint is not the same thing as a topic. Topics are a message property the event broker uses to route messages to their destination, and they aren’t administratively configured on the event broker. Topic endpoints, on the other hand, are objects that define the storage of messages for a consuming application, and they do need to be provisioned on the event broker. Topic endpoints are more closely related to queues than to topics, as confusing as that can seem at first.
Before we compare queues and topic endpoints, let’s take a high-level look at endpoints in general:
With all of that said, lets look at the question of queue vs. topic endpoint. Queues are used more often because of their support for more subscriptions, more consumers, and the ability to read without removal which is very handy for troubleshooting and special processing.
Topic endpoints may be better if you want to apply selector processing sooner to filter messages and not necessarily save them to the endpoint. Also, note that topic endpoints were originally created to support durable subscriptions in JMS, and is the only option for JMS durable subscribers.
I hope this post has helped you understand the matter of queue vs topic endpoint. If you found this post useful, visit the endpoints section of our docs, and our PubSub+ for Developers page for more information. If you have any questions about queues and topic endpoints, try posting them to the Solace Developer Community.
I have worked at Solace as a Customer Support Engineer, and as a Global Training Professional. I help customers to migrate from a siloed, monolithic architecture to an Event Driven Architecture. Solace PubSub+ enables the movement of data in an asynchronous manner, allowing distributed applications to seamlessly connect over any protocol.[position] => [url] => https://solace.com/blog/author/leahrobert/ ) )