DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Please enter at least three characters to search
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Modernize your data layer. Learn how to design cloud-native database architectures to meet the evolving demands of AI and GenAI workkloads.

Secure your stack and shape the future! Help dev teams across the globe navigate their software supply chain security challenges.

Releasing software shouldn't be stressful or risky. Learn how to leverage progressive delivery techniques to ensure safer deployments.

Avoid machine learning mistakes and boost model performance! Discover key ML patterns, anti-patterns, data strategies, and more.

Related

  • Auto-Instrumentation in Azure Application Insights With AKS
  • Deploying a Scala Play Application to Heroku: A Step-by-Step Guide
  • Why Mocking Sucks
  • Moving PeopleSoft ERP Data Between Databases With Data Mover Scripts

Trending

  • Apache Doris vs Elasticsearch: An In-Depth Comparative Analysis
  • A Complete Guide to Modern AI Developer Tools
  • Solid Testing Strategies for Salesforce Releases
  • Internal Developer Portals: Modern DevOps's Missing Piece

Understanding Solace Endpoints: Queues vs Topic Endpoints

When it comes to solace endpoints, it's best to use queues, unless you have a specific requirement for a topic endpoint.

By 
Leah Robert user avatar
Leah Robert
·
Sep. 17, 21 · Analysis
Likes (6)
Comment
Save
Tweet
Share
18.4K Views

Join the DZone community and get the full member experience.

Join For Free

One of the most frequent questions I get asked in the community is “What is the difference between a queue and 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.

What Are Solace Endpoints?

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.

Flowchart breaking down endpoint into queue and topic endpoint

Topic Endpoints vs Topics

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.

Common Characteristics of All Endpoints

Before we compare queues and topic endpoints, let’s take a high-level look at endpoints in general:

  • Topic Subscriptions: A consuming application uses subscriptions to route messages towards it. Solace endpoints can have topic subscriptions applied to attract messages to the endpoint where a consuming application receives the messages from.
  • Selectors: A conditional statement applied to an endpoint by a consuming application to filter messages by their header and user properties.
  • Queue Browsing: A consuming applications’ ability to read messages from a queue without removing them from the queue.

Queue vs Topic Endpoints

  • Sending by Name: A producing application has the option to send a message directly to a queue by referencing that queue by its name in the message properties. A producing application cannot, however, reference topic endpoints by name, and therefore only persist messages routed to the topic subscription applied to the topic endpoint.
  • Support for Multiple Topic Subscriptions: Queues support multiple topic subscriptions. This allows for topic aggregation to a single consuming application. Topic endpoints support a single subscription; should that subscription change, all messages persisted to the topic endpoint are deleted. Messages persisted in queues are unaffected by subscription changes.
  • Application of Selectors: Selectors can be applied to either type of endpoint to apply conditional logic, but the two endpoints differ in when the conditional is processed. With queues, selectors are processed at egress, and with topic endpoints, they are processed on ingress. This means that queues persist every message even if they don’t match the selector, while with topic endpoints messages are only persisted if they match both the topic subscription and the selector.
  • Support for Multiple Consumers: Queues support multiple consumers, providing a fault-tolerant option should a consuming application disconnect from the queue. Exclusive topic endpoints support a single consumer, matching the functionality of a JMS durable subscription. Non-exclusive topic endpoints can support multiple consumers for load balancing purposes.
  • Ability to Read Without Removal: Finally, a queue can be read without removing messages, whereas topic endpoints require the removal of messages to be read.

Which Endpoint Should You Use?

With all of that said, let's 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.

application

Published at DZone with permission of Leah Robert. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • Auto-Instrumentation in Azure Application Insights With AKS
  • Deploying a Scala Play Application to Heroku: A Step-by-Step Guide
  • Why Mocking Sucks
  • Moving PeopleSoft ERP Data Between Databases With Data Mover Scripts

Partner Resources

×

Comments
Oops! Something Went Wrong

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends:

Likes
There are no likes...yet! 👀
Be the first to like this post!
It looks like you're not logged in.
Sign in to see who liked this post!