For the ActiveMQ, I think the doc from its website should be helpful for you, it describes that how AcitveMQ JNDI works. e.g. Dynamically creating destinations section explains why an unexisting destination could be lookuped. http://activemq.apache.org/jndi-support.html
2011/6/28 Florian Schaetz <florian.scha...@optitool.de> > Hello, > > perhaps it's a stupid question, but I like to understand things, even if > they work fine, so here it goes: > > I've got a piece of code in my application, that connects to the Topic on > the ApplicationServer. It looks like this: > > Properties jndiProperties = new Properties(); > ... some properties > jndiProperties.setProperty("topic.TopicName", "MyTopic"); > > InitialContext initContext = new InitialContext(jndiProperties); > Topic topic = (Topic) initContext.lookup("TopicName"); > > Ok, this seems to work, I get access to the "MyTopic" topic. But there are > two question: > > a) What's the whole process for? Why can't I simply as for "MyTopic"? Isn't > there a direct way to access the topic, without the redirect through the > properties? ...lookup("topic://MyTopic") or similar things do not seem to > work. > > b) If I try ...lookup("SomeNonsense") I get an Naming-Exception, great. But > if use the code above and the "MyTopic" doesn't exist on my Geronimo, I get > no exceptions at all, even when sending to this non-existing topic - the > message simply seems to never arrive somewhere. Is there a possibility to > check if the topic is ok? > > Regards, > > Flo > > -- > OPTITOOL GmbH > > Bruderwöhrdstr. 15b > D - 93055 Regensburg > > T: +49-941-59578-26 > > eMail: florian.scha...@optitool.de > URL: www.optitool.de > > Sitz der Gesellschaft: Regensburg > Registergericht Regensburg: HR B 9544 > > > -- Ivan