activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From JohnF <>
Subject How to define properties for Topics and Queues
Date Fri, 18 May 2007 05:31:35 GMT


I tried to use JNDI and the lookup() methode to get a topic for a client.

            properties = new Hashtable<String, String>();

            Context context = new InitialContext(properties);
            ConnectionFactory connectionFactory =

            properties.put(Context.PROVIDER_URL, "tcp://localhost:61616");

           Topic destination = (Topic)context.lookup("NAME_OF_TOPIC");

It failed and I got the NameNotFoundException. If I added the following
line, it does work:

            properties.put("topic.NAME_OF_TOPIC", "NAME_OF_TOPIC");

I do not want to use a property file that is stored in the classpath. How do
I have to configure a topic or a queue to avoid defining the Name of the
destination for JNDI in the code of the client?

Thank you

View this message in context:
Sent from the ActiveMQ - User mailing list archive at

View raw message