今天查看JMS API tutorial ,把关于JMS messageing domains 的一些注意细节整理如下:
一、Point-to-Point Messaging Domain
1、Queues retain all messages sent to them until the messages are consumed or until the messages expire.
2、Each message has only one consumer.
3、
A sender and a receiver of a message have no timing dependencies. The
receiver can fetch the message whether or not it was running when the
client sent the message.
4、The receiver acknowledges the successful processing of a message.
二、Publish/Subscribe Messaging Domain
1、Topics retain messages only as long as it takes to distribute them to current subscribers.
2、Each message may have multiple consumers.
3、 Publishers and subscribers have a timing dependency. A client that subscribes to a topic can consume only messages published after the client has created a subscription, and the subscriber must continue to be active in order for it to consume messages.
4、Durable subscriptions can receive messages sent while the subscribers are not active.
5、Use pub/sub messaging when each message can be processed by zero, one, ormany consumers.