"Easynetq Tutorial"-Publishing

Source: Internet
Author: User

The simplest message delivery mode supported by EASYNETQ is publish/ subscribe . This model is a great way to eliminate consumer information providers. Publishers simply say to the world, "this has happened" or "I have this information now". It doesn't care if someone is listening, who they may be or where they are. We can add and remove subscribers to a particular message type without reconfiguring the publisher. We can also have many publishers publish the same message, add and remove publishers again, without having to reconfigure any other publishers or subscribers.

To publish using EASYNETQ (assuming you have already created an IBUs instance):

    1. Creates an instance of the message, which can be any serializable. NET type.
    2. In IBUs, the Publish method is invoked to pass it to your message instance.

This is the code ...

var New " Hello Rabbit " };bus. Publish (message);

to ensure message delivery, use the Publisher confirms .

a warning

participants in the Publish/subscribe model are ignorant of each other. Publishers simply say to the world ' this has happened ' and subscribers tell the world ' I care about this '. in this model, no one cares about a particular event is good. The message may have a subscriber, there may be 200 subscribers, or there may be no subscribers. Publishers should not care. The EASYNETQ implements this pattern. If you start publishing and no subscribers have never started, your message disappears. this is designed.

"Easynetq Tutorial"-Publishing

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.