官术网_书友最值得收藏!

Exchanges

Messages are not published directly to a queue; instead, the producer sends messages to an exchange. An exchange is responsible for the routing of the messages to the different queues. An exchange accepts messages from the producer application and routes them to message queues with the help of bindings and routing keys. A binding is a link between a queue and an exchange:

Message flow in RabbitMQ

  1. The producer publishes a message to an exchange. When you create the exchange, you have to specify the type of it. The different types of exchanges are explained in detail later on.
  2. The exchange receives the message and is now responsible for the routing of the message. The exchange takes different message attributes into account, such as routing key, depending on the exchange type.
  1. Bindings have to be created from the exchange to queues. In this case, we see two bindings to two different queues from the exchange. The exchange routes the message into the queues depending on message attributes.
  2. The messages stay in the queue until they are handled by a consumer.
  3. The consumer handles the message.
主站蜘蛛池模板: 大渡口区| 南岸区| 晋江市| 湘乡市| 隆化县| 会昌县| 安陆市| 秦皇岛市| 特克斯县| 台东市| 天津市| 大埔县| 瑞丽市| 喀什市| 宽城| 新和县| 石渠县| 黎平县| 江津市| 五常市| 梅河口市| 淮南市| 阜南县| 木兰县| 安康市| 新源县| 册亨县| 宣化县| 布尔津县| 新乡市| 江山市| 山东| 荥经县| 宿迁市| 垫江县| 扎赉特旗| 红河县| 普兰店市| 迭部县| 安丘市| 左云县|