As discussed above, a critical architectural feature of JMS is that it decouples the objects that send messages from those that receive messages. This architecture contrasts, for example, with the JavaBean event model, where an event listener must register with the object that fires the event. In the JMS messaging model, objects that send messages (called message producers) and objects that receive messages (called message consumers) do not need to be aware of each other, because a producer does not send messages directly to a consumer.

Instead, a JMS message producer sends a message to a destination, from which it is then retrieved by one or more message consumers. JMS defines two types of destinations, corresponding to two basic forms of messaging:

 
loading table of contents...