activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jworkman <jwork...@oidev.com>
Subject AMQ + Programmatic Creation of Destinations + Registration in JNDI
Date Tue, 04 Aug 2009 14:27:45 GMT

I really need help, I am struggling to create queues and topics in ActiveMQ
and have them accessible from JNDI lookups. I need this
creation/registration to be done without bringing the server down, and done
without manual configuration.

Something like:

//create the jndi context
InitialContext jndiContext = new InitialContext(loadConnectionProps());

// Create a ConnectionFactory
ConnectionFactory connectionFactory = (ConnectionFactory)
jndiContext.lookup(loadConnectionProps().getProperty(Context.OBJECT_FACTORIES));

// Create a Connection
Connection connection = connectionFactory.createConnection();

// Create a Session
Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);

// Create the destination (Topic or Queue)       
session.createQueue(qname);

************this below doesn't work***********

//get the topic from jndi 
topic = (Topic) ctx.lookup(name);

-- 
View this message in context: http://www.nabble.com/AMQ-%2B-Programmatic-Creation-of-Destinations-%2B-Registration-in-JNDI-tp24809685p24809685.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Mime
View raw message