Topic names in Queues
Publisher publishing to topic, which is mapped to a persistent queue for consumer.
e.g publisher1/A/B/C ==> publisher1_queue
(topic subscription publisher1/>)
Is there a way to identify the topic name (pulisher1/A/B/C
) by consumer who is subscribing to publisher1_queue
?
Comments
-
For sure. Just because the message ended up in the queue for the consumer, the message's Destination doesn't change. So, if you're using the Solace Java (JCSMP) API, then when you receive the message you simply do
msg.getDestination().getName();
. https://docs.solace.com/API-Developer-Online-Ref-Documentation/java/com/solacesystems/jcsmp/XMLMessage.html#getDestination()BTW, I really wouldn't suggest naming your queue after the publisher. Queues really "belong" to the consumer, acting as the persistent storage for while they're slow or offline.
3 -
Hey, I talked about this question on my "office hours" stream last week. Check it out: https://youtube.com/watch?v=d6vHFle74g0&t=2205s
0