"Getting Started-2" ACTIVEMQ learning-producers and consumers

Source: Internet
Author: User

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

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.