Java Tutorial - Java Scipt : Types of Messaging Models

Java Tutorial - Java Scipt :

Types of Messaging Models

The two types of messaging models, queues and topics, share many similarities.In previous releases of the JMS specification, the two models were treatedas entirely separate. Experience has shown that many of the conceptual differencesbetween the queue model and the topic model are unnecessary. Beginning with version 1.1, the JMS specification unifies the queue and topic models. Aqueue is like a line for messages. When you produce a message, it is added to the queue. When you remove a message from a queue, it is consumed. Between the time a message is produced and consumed, the message waits in the queue. Atopic is like a queue, except that it extends the 1:1 model to a 1:n model. To receive messages from a topic, a consumer must subscribe to it. Any number of consumers may be subscribed to the same topic. When a new message is produced, each of those subscribers will receive a copy of the same message.