This might seem like an extra, unnecessary layer of software, but the advantages a message service provide often outweigh this single disadvantage. The message service model is much like the model behind the postal service. We could directly deliver our own mail, but letting someone else do it greatly simplifies our life. The common building block of a messaging service is the message. Messages are events, requests, and replies that are created by and delivered to enterprise applications.
Messages contain formatted data with specific business meanings.
Beyond the message, however, messaging services display a surprising degree of diversity. In addition, every messaging service packages these capabilities slightly differently. A key goal of the JMS API is to unify the packaging of these capabilities and to minimize the set of concepts a Java programmer must learn in order to use messaging products. As its secondary goal, it strives to maximize the portability of messaging applications. The JMS API is divided into two nearly identical pieces.