JMS is a standard Java messaging API that provides a common mechanism for Java-language programs to access messaging systems. Java clients and middle-tier components must be capable of using messaging systems to access the J2EE components that are enabled via a messaging layer.
Application clients, EJB components, and Web components can send or synchronously receive a JMS message. Application clients can also receive JMS messages asynchronously.
A new kind of enterprise bean introduced in EJB V2.0, the message-driven bean, enables the asynchronous consumption of messages. A message-driven bean can be accessed by sending a method invocation request over a messaging infrastructure. A JMS provider may optionally implement concurrent processing of messages by message-driven beans.
The J2EE specification requires JMS providers to implement both the reliable point-to-point messaging model and the publish/subscribe model. The reliable point-to-point messaging model allows one entity to send messages directly to another entity that understands the format of the messages and the requests. The publish/subscribe model is event driven; a message is published, and the message is delivered to all subscribers of the event. One example is a StockQuote application, with multiple traders wanting to get the latest stock quote. In this scenario, the traders' applications subscribe to the stock-quote messaging service. When the stock values are published, the information is made available to all the subscribers. In a Java environment, both the StockQuote server and the traders' applications can use the JMS mechanism with a JMS provider to achieve the required messaging fucntionality.
However, JMS does not specify a security contract or an API for controlling message confidentiality and integrity. Security is considered to be a JMS-provider-specific feature. It is controlled by a System Administrator rather than implemented programmatically or by the J2EE server runtime.