Getting messages from all topic subscription even if subscribing to specific topic

Amol D
Amol D Member Posts: 7

Hi,

I have client code which creates the subscription on queue and its topic, now when i am trying to consume the message from specific topic subscription with below code, consumer is receiving the messages from other topic subscription too under the same queue

For example, when I am subscribing to "Demo/Msg" , I am expecting my listener should only get called when there are messages published/available on "Demo/Msg", but its also consuming the messages from topic "Demo", even if i didn't creating consumer to it.

queueName": "QUE_TEST"

 "subscription_topics": [

    "Demo/Msg",

    "Demo"

   ]

.net code below, Please advise, 


Comments

  • arih
    arih Member, Employee Posts: 125 Solace Employee

    hi @Amol D ,

    Looks like your code is consuming from the QUE_TEST and added the Demo/Msg topic subscription to that Queue when connecting.

    And I'm guessing that QUE_TEST is already created and already had "Demo" as another topic subscription.

    In that case, your app will actually receive any messages published with those two topics: Demo and Demo/Msg.

    I think this is similar to your other question, when your app is consuming from a Queue, you shouldn't need to worry about the topic (decoupling it) - but instead making use of the persistency. If you need specifically only Demo/Msg, then you either subscribe with Direct Messaging or create a new Queue with only Demo/Msg topic subscription.

    Hope that helps.

    -Ari

  • Tamimi
    Tamimi Member, Administrator, Employee Posts: 491 admin