I'm not clear on what you mean by "dynamic topic." Are you referring to what the JMS specification calls a "temporary topic"? If so, you can use javax.jms.Session.createTemporaryTopic().
If you're talking about something else, it's likely you can accomplish what you need via our management layer which is accessible via JMX, Core, or JMS. See the documentation on this (including examples) for more details.
If neither of those suits your need please clarify your use-case.
I was looking for something like Topic topic = javax.jms.Sesesion.createTopic("TopicName") and the publish to this destination. I couldn't find any sample on how to create a topic on the fly... would appreciate any suggestions you might have.
I looked over the management API and while I see that I can add various metrics/notifications for a queue/topic is still unclear to me how to create topics on the fly and publish to those topics.
I was looking for something like Topic topic = javax.jms.Sesesion.createTopic("TopicName") and the publish to this destination.
While JMS does have javax.jms.Session.createTopic(String), this method only instantiates a reference to the topic in question and does not administratively create it. I've seen this method most often used simply as a way to avoid a JNDI look-up.
I couldn't find any sample on how to create a topic on the fly... would appreciate any suggestions you might have.
We don't have any examples specifically demonstrating how to create a topic, but you can use either the "jmx" or "management" example as pattern and simply use the JMSServerControl interface to create the topic and bind it into JNDI where you need. Once you do that then you can look it up from any client.
Hi Justin, thanks for you feedback! Very helpful... i'll poke around more management API and give it a try.