存档

文章标签 ‘JMS’

JMS 入门-1

2009年12月6日 admin 没有评论

There are two main concepts in JMS: message brokers and destinations.

When an application sends a message, it hands it off to a message broker. A Message broker is JMS’s answer to the post office. The message broker will ensure that the message is delivered to the specified destination, leaving the sender free to go about other business.

Point-to-point messaging model

In the point-to-point model, each message has exactly one sender and one receiver. When the message broker is given a message, it places the message in a queue. When a receiver comes along and asks for the next message in the queue, the message is pulled from the queue and delivered to the receiver. Because the message is removed from the queue as it is delivered, it is guaranteed that the message will be delivered to only one receiver.

image

Publish-subscribe messaging model

In the publish-subscribe messaging model, messages are sent to a topic. As with queues, many receivers may be listening to a topic. However, unlike queues where a message is delivered to exactly one receiver, all subscribers to a topic will receive a copy of the message.

 

image

分类: JAVA 标签: