RabbitMQ Exchange Mode-fanout

Source: Internet
Author: User
Tags bind rabbitmq

Installing the RabbitMQ server environment under Windows


RabbitMQ Exchange Mode-Direct

RabbitMQ Exchange Mode-fanout

RabbitMQ Exchange Mode-topic




Any messages sent to Fanout Exchange will be forwarded to all the queue with that Exchange binding (binding).


1. This mode requires early binding of exchange to queue, one exchange can bind multiple queues, and one queue can bind to multiple Exchange


2. This mode does not require Routekey


3. If exchange that receives the message is not bound to any queue, the message is discarded.



Reference code:




Call Execution Code:




View the results of the execution:



View Exchange (already bound to Fanout.1, fanout.2, and fanout.3):




After binding, sending messages to Fanout.1, Fanout.2, fanout.3, and any one queue will be broadcast to the three (Fanout.1, fanout.2, fanout.3) queues at the same time


For example, the following code sends a message to Fanout.1, but Fanout.2 and Fanout.3 are also broadcast to a total of 2 messages:






Test code, click Download



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.