JMS Message Delivery model :
The messaging mechanism is based on pull or poll (polling) .
There are two " messaging models " for JMS: Peer and pub/sub.
(1) Peer: Point-to-point messaging model that allows JMS clients to synchronize or asynchronously send messages through the queue (queues) virtual channel ; The producer of the message is Sender and the consumer is receiver.
Receiver actively requests the message to the queue , not the JMS provider pushing the message to the client ;
The main reason is that a queue channel may have multiplereceiver,eachreceivermay have different processing rates for messages(different blocking times caused by processing messages),forJMSby the provider,it doesn't realize whichreceiverin"Idle"Status,ifJMSa provider's proactive push can cause a blockage of the channel or a backlog of messages on the client.;so based on the client Pullthe way,whenreceiverIdle time toJMSProvider Request Message,It's a good solution to this problem.,and it's good to be able to"Load Balancing".
if a message in the Queue is successfully received by a recervier ( confirmed success ) , the message is removed .
Peer Messaging mode supports asynchronous " out-of-the-box " and synchronous " request / reply ".
(2) Pub/sub: In the publish /subscribe model , messages are published to a virtual channel named Subject (Topic) , the producer of the message is Publisher, the consumer is Subscriber, published to messages in the Topic can be received simultaneously by multiple clients .
Pub/subMessage delivery model is based on push(push), JMSthe provider proactively pushes messages to and from the client,similar to broadcasting;the reason for this approach,It's really good to understand.,since each client should receive a message,Then forJMSby the provider,only need to traverse all the"Active"the link,send the message out in turn,Without the client"Futile"The Go polling.
Inpub/subinside the Model,There are many different types of subscribers;Non-persistent subscribers are temporary subscribers,They are only actively listening to the topic to receive messages;Persistent Subscribers will receive every message that is published,even if its link is in the"Offline".In addition, there are"Dynamic Persistent Subscribers"and the"Managed Persistent Subscribers".
Jms The provider supports " message " any sent to JMS , Will first be persisted ( for non-persisted types of data , is based on This kind of effective guarantee strategy (" Save and forward effectively ensures the security of the message
JMS message transport mechanism