🎄 Happy Holidays! 🥳

Most of Solace is closed December 24–January 1 so our employees can spend time with their families. We will re-open Thursday, January 2, 2024. Please expect slower response times during this period and open a support ticket for anything needing immediate assistance.

Happy Holidays!

Please note: most of Solace is closed December 25–January 2, and will re-open Tuesday, January 3, 2023.

unique topic subscription id ?

alinaqvi
alinaqvi Member Posts: 35
edited February 2020 in PubSub+ Event Broker #1

Is there a unique subscription id generated when we do a subscribe request to a topic (similar to a cache request id) ?

Topic solaceTopic = JCSMPFactory.onlyInstance().createTopic("abc/topic");
session.addSubscription(solaceTopic);

If I can get or add a unique id for the subscription above which would be part of the received messages then I can do a performant routing of messages internally in our app.

I appreciate that it might not be possible but asking just incase.

Many Thanks,
Ali

Comments

  • marc
    marc Member, Administrator, Moderator, Employee Posts: 963 admin

    Hi @alinaqvi,
    Can you share more about what problem you're trying to solve? There is no given unique id when you add a subscription, however each message has a destination property where you can see what topic it was published to.

    https://docs.solace.com/API-Developer-Online-Ref-Documentation/java/com/solacesystems/jcsmp/XMLMessage.html#getDestination()

  • alinaqvi
    alinaqvi Member Posts: 35

    Hey marc,
    I am just trying to route messages(in our app internally) where I have subscribed to multiple topics within the same solace session. So basically trying to implement the missing 'topic dispatcher' functionality ourselves.
    For solcache topics I can use the cacheRequestId so I just wanted to know if its possible for normal topics.
    I guess not. Thanks for your quick reply.

  • TomF
    TomF Member, Employee Posts: 412 Solace Employee
    edited February 2020 #4

    @alinaqvi We have topic dispatch within some of our APIs: e.g. Our C and .Net APIs. It isn't support in the Java API , which appears to be the one you're using. As Marc says, you can interrogate and route messages based on the destination header property.