Java Message Service(The Java Messaging Service, referred to as JMS) solves this problem partly by providing a way to interact with Java EE applications or traditional systems.
The universal interface collection of JMS sends or receives messages asynchronously. Receiving messages asynchronously is clearly the best choice for clients that use intermittent network connections, such as mobile phones and PDAs. In addition, JMS uses a loosely coupled approach to consolidating enterprise systems, whose primary goal is to create portable enterprise-class applications that can use Cross-platform data information, freeing the development workforce.
The Java Messaging Service supports two message models: Point-to-Point messages (Peer-to-peer) and publishing subscription messages (Publish Subscribe messaging, referred to as pub/sub). The JMS specification does not require vendors to support both message models at the same time, but developers should be familiar with the advantages and disadvantages of the two message models.
The Peer-to-peer messaging model is used when passing messages between point-to-point points. If the application developer wants every message to be processed, the Peer-to-peer messaging model should be used. Unlike the PUB/SUB message model, Peer-to-peer messages can always be routed to a specified location.
The PUB/SUB model is used when one or more messages are broadcast. Application developers can also use the PUB/SUB message model if the reliability of a certain degree of message delivery is acceptable. In other words, it applies to all message consumption programs that do not require the ability to receive all of the information or the message consumption program and do not want to receive any messages.
JavaMail is a sun-released API for handling emails. It makes it easy to perform some common message transfers.
Although JavaMail is one of the Sun's APIs, it has not yet been added to the standard Java Development Toolkit (Java Development Kit), which means that you must download the JavaMail file separately before you use it. In addition, you will need to have Sun's JavaBeans activation Framework (JAF). The operation of the JavaBeans activation framework is complex, and it is simple to say that JavaMail's operation must depend on its support. The path to specify these files is used under Windows 2000 and is similar on other operating systems.
The Java Mail API, an extension of Java's e-mail processing, provides a Java solution unrelated to the communication contract, and can handle a variety of email formats, including IMAP, POP, SMTP, and Mi ME, and other Internet-related messaging protocols.
Recommended reference: Http://www.mldn.cn/articleview/2007-1-16/article_view_854.htm