I have multiple applications that registers as publishers/subscribers to some common topics sitting in between them.
Is there any way I can declare the topics more than once without getting deployment errors? I have set up dependencies correctly so that each app requires the existence of particular topics using JBoss deployment.xml files. But I'm considering the best option for actually deploying the topics.
I'd like to have each application self-contained, meaning that the hornetq-jms.xml file for each app should consist of the necessary queues/topics for that app. But if multiple applications declare the same HornetQ resource (queue or topic) I get the error message "name "myTopic" is already installed" during deployment as another app might have already registered this topic.
It makes sense to deploy queues only in the receiving app and put a dependency for it in all senders, but topics can have multiple subscribers so that's another use case.
I could theoretically create a common aggregated hornetq-jms.xml file and deploy it outside the application, but that would not let my apps be selfcontained.
Is there a way to tell Hornet that:
- I'd like this queue/topic registered if not already available?
- Otherwise, just use the one already provided for me.
That is a bit messy, right?
What if you undeploy application 1, and application 2 is still up? How undeploy should work.
Make the analogy with a Database application.. you should (most of the times) create the tables before you create your application.
You should do the same, especially on this case. Otherwise you're entering into a big mess.