users@glassfish.java.net

How to connect to embedded JMS from external client?

From: <glassfish_at_javadesktop.org>
Date: Sun, 10 Oct 2010 05:37:26 PDT

Dear all,

for my first JMS application, as supplied in the book "Java Message Service", I did install Apache ActiveMQ for testing. The simple test app is a chat, which works with ActiveMQ.

Now I would like to connect to the embedded MQ (i think it is OpenMQ?) shipped with GlassFish 3.0.1. In order to do so, this standalone application now includes a Maven dependency to gf-client.

However, I have no clue what classname and JNDI properties to supply in jndi.properties; I am not sure if this jndi.properties is needed for GlassFish.

The InitialContext is defined as follows:

--8<--
// Obtain a JNDI connection using the jndi.properties file
InitialContext ctx = new InitialContext();

// Look up a JMS connection factory
TopicConnectionFactory cf = (TopicConnectionFactory) ctx.lookup("jms");
-->8--

How do i configure the InitialContext to fetch the TopicConnectionFactory from a remote GlassFish?

Thanks.
[Message sent by forum member 'pwn4g3']

http://forums.java.net/jive/thread.jspa?messageID=484824