JMS Two message models are defined in: Point to point(point to point, queue) And publish/ Subscribe(publish/subscribe,topic). The main difference is
Whether it can be re consumed.

Point to point:Queue, Unrepeatable consumption
Message producer production message sent toqueue in, Then the message consumer fromqueue To retrieve and consume messages.
After the news is consumed,queue No more storage in, So it's impossible for news consumers to consume the information that has been consumed.
Queue Support multiple consumers, But for a message, Only one consumer can consume, Others cannot consume this message.
When the consumer does not exist, Message will be saved all the time, Until there is consumption

Release/ Subscribe:Topic, Can be re consumed
Message producer( Release) Publish message totopic in, Multiple message consumers at the same time( Subscribe) Consume the message.
Different from point-to-point, Publish totopic Will be consumed by all subscribers.
When the producer publishes a message, Whether there are consumers or not. No messages will be saved



Jms Two kinds of normsmessage transmission modeTopic andQueue, The comparison between the two is as follows():




  Topic Queue
outline Publish  Subscribe messaging Publish subscription message Point-to-Point  Point to point
Presence or absence topic Data does not land by default, Is stateless.
Queue By default, the data will bemq Saved as a file on the server, such asActive
MQ Generally stored in$AMQ_HOME\data\kr-store\data Below. It can also be configured asDB storage.

Integrity assurance No guaranteepublisher Every data published,Subscriber It's acceptable. Queue Ensure that every data can bereceiver Receive.
Whether the message will be lost
generally speakingpublisher Publish a message to atopic Time, Only listening for thistopic Addresssub Able to receive messages; Withoutsub Monitoring, Thetopic It's lost..
Sender Send message to destinationQueue,receiver You can receive this asynchronouslyQueue News on.Queue If there is no message onreceiver Come and take, It will not be lost.
Message publishing and receiving policy One to many strategy for message publishing and receiving, Monitor the sametopic Multiple addressessub Can receive it.publisher Messages sent.Sub Receive notificationmq The server
A one-to-one strategy for message publishing and receiving, Onesender Messages sent, Only onereceiver Receive.receiver After reception, noticemq Server received,mq Server pairqueue Delete or other actions are taken for messages in.