JMS destination showing as topic, eventhough the message is consumed from queue

Navmi
Navmi Member Posts: 1

Consuming messages from queue, but while analysing the received message, observed that the JMS destination is showing as the topic name which is subscribed to the queue. Can you explain why the received message's destination is not showing as queue instead the topic.

Tagged:

Comments

  • TomF
    TomF Member, Employee Posts: 409 Solace Employee

    Hi @Navmi,

    If I understand you correctly, you have a message that has been produced to a topic. The message was then attracted to a queue, using a subscription on that queue.

    If this is the case, then the original destination set by the message producer was a topic. This is a property created as part of the message before the message is sent to the broker, so to change the property to the queue, the broker would have to over-write it.

    Secondly, one of the ideas behind sending a message to a topic and having queues subscribe to the topic is that this means one message can land on multiple queues. This means that the only way to know how the message landed on the queue is by finding out to which topic the message was sent.

    You can tell which queue the message landed on by looking at which queue you're bound to.

    Lastly, if you follow our topic taxonomy best practices, a lot of useful information can be found in the topic which you may want to access.