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

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.
主站蜘蛛池模板: 收藏| 天津市| 余江县| 娄烦县| 高平市| 宁明县| 壤塘县| 瑞安市| 沭阳县| 凉城县| 平利县| 济南市| 金堂县| 比如县| 邻水| 利辛县| 黄山市| 乐亭县| 易门县| 阳原县| 紫阳县| 天津市| 乐平市| 柞水县| 阜新| 扎鲁特旗| 漳浦县| 台中县| 汉中市| 抚远县| 芜湖县| 武穴市| 攀枝花市| 江达县| 会同县| 五莲县| 崇义县| 襄汾县| 通渭县| 都江堰市| 沙雅县|