-
Notifications
You must be signed in to change notification settings - Fork 41.3k
added sample usage of ActiveMQ Topic (use both Queue and Topic in same app) #6356
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
… and Topic in same app)
Thank you for the PR but that's a lot of code for a sample. For one the If you find this confusing, how about improving the doc? Probably in Spring Framework then but if you submit a PR here, I am more than happy to review it as well. |
basically, I have discovered that you can either subscribe to Queue or to a
Internally, it is because spring-boot create a default autoconfigured This was not really the case when using springframework directly, because Of course, it is true that it might be much simpler if springframework was Regards, Arnaud 2016-07-08 10:07 GMT+02:00 Stéphane Nicoll notifications@github.com:
|
@Arnaud-Nauwynck something puzzles me in your description. ActiveMQ creates JMS destinations on the fly for you so if you have a setup with a destination named
If you have a listener on a destination and that destination doesn't exist, you'll get a big stacktrace in the logs. If you have a setup that works differently, please share it (that would be a spring framework issue by the way). Also |
for my tests, I started ActiveMQ, and connected to the web admin page, then 2016-07-10 11:33 GMT+02:00 Stéphane Nicoll notifications@github.com:
|
Do you have already solved the problem, I also met the same problem. |
I have forked it, and made a pull request but the example was too long and the pull request was closed. basically, you have to use 2 distinct JmsListenerContainerFactory wether you listen to a Queue or to a Topic
|
I found it non-intuitive to subscribe both to a Topic and a Queue in single spring-boot / springframework application.
The following code seems OK, but does not work
so I have enhanced the sample "spring-boot-samples/spring-boot-sample-activemq" to make it work
Basically, you have to be explicit to use a bean configuration "jmsListenerContainerTopic" ...
@JmsListener(destination = "TestTopic1", containerFactory="jmsListenerContainerTopic")