Topic to Queue Mapping
2 Minute Read
This tutorial builds on the basic concepts introduced in Persistence with Queues tutorial and will show you how to make use of one of Solace’s advanced queueing features called “Topic to Queue Mapping.”
In addition to persistent messages published directly to a durable queue, it is possible to add one or more topic subscriptions to the queue so that messages published to those topics are also delivered to and persisted by the queue. This is a powerful feature that enables queues to participate equally in point-to-point and publish/subscribe messaging models. More details about the “Topic to Queue Mapping” feature here.
The following diagram illustrates this feature.
If you have a durable queue named “Q”, it will receive messages published directly to the queue destination named “Q”. However, it is also possible to add subscriptions to this queue in the form of topics. This example adds topics “A” and “B”. Once these subscriptions are added, the queue will start receiving messages published to the topic destinations “A” and “B”. When you combine this with the wildcard support provided by Solace topics this opens up a number of interesting use cases.
AMQP is a standard protocol with a design goal of being messaging middleware agnostic. As such, it does not provide a way for applications to directly take advantage of the Solace Topic to Queue Mapping feature.
However Node.js applications wishing to take advantage of this Solace feature can use a management interface to administratively configure the topic to queue mapping, by adding topic subscriptions to the queue. This can either be done through the CLI or PubSub+ Manager application; or the SEMP programmatic management API. The SEMP API enables applications to fully configure Solace messaging.
Applications can use this API by logging into Solace messaging using a Message-VPN admin account. This concept is introduced in the Technology – Messaging Platform Features and further details are available in the Solace Message Router Product Documentation.
Node.js applications wishing to take advantage of this feature have the option of using one of the Solace management interfaces and directly configure the topic subscriptions on the queue.