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.

《RabbitMQ in action》的更多相关文章

  1. 【推荐】《Netty in action》书籍

    最近准备开始阅读一下<Netty in action>并且准备构架设计一个分布式系统.用于新项目. 貌似压力很大啊.压力就是东西.希望自己能够调节好. Netty in action是Ne ...

  2. 《Go in action》读后记录:Go的并发与并行

    本文的主要内容是: 了解goroutine,使用它来运行程序 了解Go是如何检测并修正竞争状态的(解决资源互斥访问的方式) 了解并使用通道chan来同步goroutine 一.使用goroutine来 ...

  3. 《ActiveMQ in Action》【PDF】下载

    内容介绍TheApache ActiveMQ message broker is an open source implementation ofthe Java Message Service sp ...

  4. 《maven in action》部分知识点总结

    maven in action 的部分知识点总结 今天又将<maven in action>这本书看了一遍,总结了一下,大概需要的知识点 (一)解耦   使用maven,在没有任何实际的J ...

  5. 《Netty in action》 读书笔记

    声明:这篇文章是记录读书过程中的知识点,并加以归纳总结,成文.文中图片.代码出自<Netty in action>. 1. 为什么用Netty? 每个框架的流行,都一定有它出众的地方.Ne ...

  6. Netty | 第1章 Java NIO 网络编程《Netty In Action》

    目录 前言 1. Java 网络编程 1.1 Javs NIO 基本介绍 1.2 缓冲区 Buffer 1.2 通道 Channel 1.3 选择器 Selector 1.4 NIO 非阻塞网络编程原 ...

  7. 《Netty in action》目录修复版本分享

    最近阅读了Netty in action一书.深感外国友人的书籍编写能力强大.作者由简入深.精简描述了Netty的相关知识,如何使用等等. 本来想翻译一下的.尝试着翻译了一点之后.发现非常痛苦啊.ps ...

  8. 《Spring In Action》阅读笔记之装配bean

    Spring主要装配机制 1.在XML中进行显式配置 2.在Java中进行显式配置 3.隐式的的bean发现机制和自动装配 自动化装配bean Spring从两个角度来实现自动化装配 1.组件扫描:S ...

  9. 重读《Struts In Action》

    Figure   1.1. The Java Servlet API exposes the HTTP client/server protocol to the Java   platform. S ...

随机推荐

  1. jquery文字左右滚动

    实现jquery文字左右滚动 <div class="fl">中奖名单:</div> <div class="scrollText" ...

  2. log4j配置只打印指定jar或包的DEBUG信息

    有的时候查问题的时候需要打印第三方jar里面的debug信息,假如全部jar都打印的话日志文件会很大,这个时候可以配置log4j只打印指定jar的debug信息或者包,同时输出到了一个新的文件中. 比 ...

  3. MySQL忘记密码后重置密码(Mac )

    安装好MySQL以后,系统给了个默认的的密码,然后说如果忘记了默认的密码......我复制了默认密码就走过了这一步,这一步就是我漫长旅程的开始.他给的密码太复杂了,当然我得换一个,而且我还要假装我不记 ...

  4. 开发问题记录——ArcEngine问题记录

    ArcEngine 使用Winform进行坐标投影变换,用到AE空间,出现如下错误:   “ESRI.ArcGIS.esriSystem.IXMLSerialize”在未被引用的程序集中定义.必须添加 ...

  5. WCF 宿主与通信模式(二)

    宿主 每个WCF服务都必须托管在Windows进程中,该进程称为宿主进程(host process) 单个宿主进程可以托管多个服务,相同的服务类型也可以托管在多个宿主进程中. wcf中托管服务一般有一 ...

  6. 将XML文件保存到DataGridView中

    #region get护理单记录信息XML //将XML文件保存到DataTable private DataTable FromXML2DataTable(string XMLStr,string ...

  7. asp.net get server control id from javascript

    var WhateverValue = document.getElementById('<%= saveValue.ClientID %>').value

  8. JavaScript 防止事件冒泡

    在我们书写一个弹窗的时候,我们往往需要点击弹窗的其他地方来隐藏弹窗. 通常我们会写成: $(document).bind('click',function(){ $('.pop-box').hide( ...

  9. MySQL 5.1.63 单机配置多实例(简单配置)

    需求: 在一台服务器上通过源码编译安装一个版本为5.1.63版本MySQL数据库: 方案:将所有配置文件与数据等均存放在/home/zhaoshuangshuang下.在同一个MySQL中运行两个实例 ...

  10. SVN 提交必填备注Commit

    操作方法:在SVN的Repositories下,找到要配置的项目,在项目目录下找到hooks文件夹,在其下创建pre-commit.bat文件,把下面复制进去就可以了(无需重启,如果改动,保存bat文 ...