users@glassfish.java.net

Re: Java Message Service

From: <glassfish_at_javadesktop.org>
Date: Thu, 24 May 2007 11:26:59 PDT

The best approach is to code your Swing client as a Java EE Application Client component.
That way you can use simple Java EE 5 annotations to acquire the JMS connection factories
and Queues/Topics, without having to worry about doing JNDI lookups. It also gives your
client code the same portability guarantees as web components / EJBs and provides
automatic access to basic Java EE container services such as authentication and security
propagation.

You can see an example of an Application Client that uses JMS
in the Message-Driven Bean section of the Java EE 5 tutorial
http://java.sun.com/javaee/5/docs/tutorial/doc/

We also have a simple "Hello,World" example here :

https://glassfish.dev.java.net/javaee5/ejb/examples/MDB.html

If you prefer to write a plain Java standalone client, you can follow the guidelines listed
in the EJB FAQ. The only difference is instead of providing the global JNDI name of
a Remote EJB you'll be providing the global JNDI name of the required JMS
connection factory or queue/topic.

https://glassfish.dev.java.net/javaee5/ejb/EJB_FAQ.html#StandaloneRemoteEJB

 --ken
[Message sent by forum member 'ksak' (ksak)]

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