Solace-JMS Dynamic Subscriptions.

arun_xi_kumar Member Posts: 3
edited February 2022 in General Discussions #1

What would be the best option to subscribe & unsubscribe to Topics/Queues dynamically with solace-jms with out using @JMSListener?
I could see a couple of options as listed below:
I) Initiating JmsListenerContainerFactory for individual endpoints.
ii) Making use of Connection instance to create JMS Session and having the subscription.

And for un-subscription making use of Session.unsubscribe() method call.



  • Aaron
    Aaron Member, Administrator, Moderator, Employee Posts: 541 admin

    Just to confirm, this is for Spring, right? And are you intending to use persistent or non-persistent messages? Thanks!

  • arun_xi_kumar
    arun_xi_kumar Member Posts: 3

    Yes, It's Spring based with" solace-jms-spring-boot-starter#3.0.0" dependency;
    We are having both delivery modes.

  • alinaqvi
    alinaqvi Member Posts: 35

    I'll add to this question ... we are trying to use the Spring @JmsListener for both persistent and non-persistent messages. But we would like to have the ability to subscribe and unsubscribe to the endpoints as needed rather than have predefined annotated methods that start subscriptions as soon as the App starts up.
    We also do not know the names of our topics before hand so it will ideally have to be a way to programmatically start and stop subscriptions.