This content has been marked as final. Show 2 replies
For a stand-alone clinet, use something like this:
Context initial = new InitialContext(); ConnectionFactory cf = (ConnectionFactory)initial.lookup("ConnectionFactory"); Destination dest = (Destination)initial.lookup("name-of-topic-or-queue"); Connection connection = cf.createConnection(); Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
I hadn't thought of the fact that jndi can return an rmi stub of the connection factory.