This content has been marked as final.
Show 1 reply
-
1. Re: How to connect to a remote Queue from webapp
jaikiran May 22, 2006 8:08 AM (in response to cpmcda01)You need to specify the remoteserver name(or address) in the InitialContext and do a lookup for the remote queue. Something like:
// create a JNDI context Hashtable env = new Hashtable(); env.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory"); env.put(Context.PROVIDER_URL, "jnp://remoteserver:1099"); env.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces"); Context context = new InitialContext(env); // retrieve queue Queue queue = (Queue)context.lookup("queue/queueName");