[jboss-user] [JBoss Messaging] - Re: Embedded server - how to create JMS Topic?

Leos.Bitto do-not-reply at jboss.com
Wed Jul 1 04:47:37 EDT 2009


Thanks a lot for all the quick answers! Navigating me to JMSServerManagerImpl was exactly what I needed. I do not like JMSServerManagerImpl much for embedding, though, because of two reasons. First is that it somehow automagically picks the file jbm-jms.xml, which in my case belongs to a different server instance and therefore must not be used. Second is that it registers the queues and topics into JNDI (passing null as the secong argument to createTopic leads to NullPointerException) and I am trying to avoid JNDI in this case. So I have just borrowed a bit of your code from JMSServerManagerImpl.java and this works fine for me:

final SimpleString t = JBossTopic.createAddressFromName(name);
server.createQueue(t, t, new SimpleString("__JBMX=-1"), true, false);

It would be nice if you could make the String "__JBMX=-1" available somewhere from your code. Maybe just change the private static final field REJECT_FILTER in JMSServerManagerImpl from private to public?

Regarding using the core API directly instead of JMS - that is a possibility, of course. However, I am trying to stick with JMS, because that makes my code compatible with many other messaging implementations, too, instead of binding it tightly to JBoss Messaging.

View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4241082#4241082

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4241082



More information about the jboss-user mailing list