zoukankan      html  css  js  c++  java
  • 《RabbitMQ in action》

    Producers create messages and publish (send) them to a broker server (RabbitMQ).What’s a message? A message has two parts: a payload and a label. The payload is the data you want to transmit. It can be anything from a JSON array to an MPEG-4 of yourfavorite iguana Ziggy. RabbitMQ doesn’t care. The label is more interesting. It describes the payload, and is how RabbitMQ will determine who should get a copy of your message. Unlike, for example, TCP, where you specify a specific sender and a specificreceiver, AMQP only describes the message with a label (an exchange name andoptionally a topic tag) and leaves it to Rabbit to send it to interested receivers based on that label. The communication is fire-and-forget and one-directional. We’ll getmore details about how RabbitMQ interprets the label later when we talk about exchanges and bindings. For now, all you need to know is that producers create messagesand label them for routing (see figure 2.1).

    Consumers are just as simple. They attach to a broker server and subscribe to a
    queue. Think of a queue as a named mailbox. Whenever a message arrives in a particular
    mailbox, RabbitMQ sends it to one of the subscribed/listening consumers. By the

    time a consumer receives a message, it now only has one part: a payload. The labels
    attached to the message don’t get passed along with the payload when the message is
    routed. RabbitMQ doesn’t even tell you who the producer/sender was.

     , if you need
    to know specifically who produced an AMQP message, it’s up to the producer to
    include that information as a part of the message payload.

    First, you need to understand queues. Conceptually, there are
    three parts to any successful routing of an AMQP message: exchanges, queues, and
    bindings. The exchanges are where producers publish their messages, queues are
    where the messages end up and are received by consumers, and bindings are how the
    messages get routed from the exchange to particular queues.

  • 相关阅读:
    C#根据当前日期获取星期和阴历日期
    C#常用实例
    使用Open Live Writer在博客园发表博文随笔
    Excel公式中双引号和单引号输入和显示以及函数的选择确认
    outlook新邮件到达提醒设置以及outlook最小化到托盘设置
    Windows任务计划
    酷狗音乐盒缓存文件夹KuGouCache的设置方法
    Android SDK生成时,自定义文件名称,而非系统第一分配的app-release.apk
    android button text属性中英文大小写问题
    Diskpart使用说明
  • 原文地址:https://www.cnblogs.com/youxin/p/3964241.html
Copyright © 2011-2022 走看看