JMS Domain-JMS 消息傳遞方式

THE POINT-TO-POINT DOMAIN
        The point-to-point (PTP) messaging domain uses destinations known as queues.
Through the use of queues, messages are sent and received either synchronously or
asynchronously. Each message received on the queue is delivered once and only
once to a single consumer. This is similar to a person-to-person email sent through a
mail server. Consumers receive messages from the queue either synchronously using
the MessageConsumer.receive() method or asynchronously by registering a
MessageListener implementation using the MessageConsumer.setMessage-
Listener() method. The queue stores all messages until they’re delivered or until
they expire.
        Multiple consumers can be registered on a single queue as shown in figure 2.6, but
only one consumer will receive a given message and then it’s up to that consumer to
acknowledge the message. Note that the message in figure 2.6 is sent from a single
producer and is delivered to a single consumer, not all consumers. As mentioned earlier,
the JMS provider guarantees the delivery of a message once and only once to the
next available registered consumer.
In this regard, the JMS provider is distributing the
messages in a sort of round-robin style across all the registered consumers.dom

PTP 這種消息分配模式是:每次JMS provider 會把一個消息 發給一個Consumer 不會同時發送給兩個Consumer.async

摘自:《ActionMQ in Action》ide

相關文章
相關標籤/搜索