1 Producers, 1 consumers, using a queue:
Mode 1:The producer sends the message to the queue, exits, and then runs the consumer:, as you can see, the message can be received. Mode 2: Run the Consumer program first: then run the producer: consumers See:1 Producers, 2 consumers, using a queueRun Consumer 1 First:
In running Consumer 2: Next Run Producer: Below is the consumer situation::Summary: 1. When a queue is used, the producer can consume the message only if it is sent to the MQ server side, without having to run the producer program; 2. The message is in the first-in, first-out order, and once a consumer consumes the message, that message is deleted from the MQ server queue; 3. There are articles that say, "producer" <--> "Consumer" is a one-to-one relationship, in fact, is not accurate, from the above can be seen, a producer of news, can be a number of consumers to consume, but many consumers in the consumption of news is the relationship of competition, first get the first consumption, once the consumption is complete, The message will be out of the queue, it can not be consumed by other consumers, that is, "disposable consumption."
From for notes (Wiz)
List of attachments
"Getting Started-2" ACTIVEMQ learning-producers and consumers