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. Linux的网卡由eth0变成了eth1,如何修复 (转载)

    Linux的网卡由eth0变成了eth1,如何修复   使用wmware安装了linux,安装成功后,使用的网卡是eth0,没有eth1.但是用过一段时间后,不知道为什么eth0无法使用,系统却自动生 ...

  2. webuploader上传插件

    一:官网 http://fex.baidu.com/webuploader/ 二:示例

  3. php程序备份还原mysql数据库

    <?php $link = mysql_connect("localhost", "root",""); mysql_query(&q ...

  4. 微信公众号-开发者-自定义菜单-CLICK事件处理

    想点击菜单,推送消息.功能很简单,坑了我一天时间.在此笔记. 菜单代码: { "button":[ { "type":"click", &q ...

  5. Linux编辑器vi使用方法详细介绍

    vi编辑器是所有Unix及Linux系统下标准的编辑器,它的强大不逊色于任何最新的文本编辑器,这里只是简单地介绍一下它的用法和一小部分指令.由于对Unix及Linux系统的任何版本,vi编辑器是完全相 ...

  6. C# 读取oracle 中文乱码的解决方案

    用OracleDataAccess.dll访问oracle数据库,遇到中文乱码的情况. 解决方案如下: 1查看字符集编码, 在数据库服务器端 启动 sqlplus SQL->select use ...

  7. [译] ASP.NET 生命周期 – ASP.NET 上下文对象(七)

    使用 HttpRequest 对象 HttpRequest 对象描述的是一个正在被处理的 HTTP 请求.下表列举了 HttpRequest 中的属性,它们提供了当前请求的相关信息(HttpReque ...

  8. Unity3d读取.csv文件

    原文地址:http://blog.csdn.net/dingkun520wy/article/details/26594991 (一)文件路径 需要把csv文件放在StreamingAssets这个文 ...

  9. 【BZOJ 1015】[JSOI2008]星球大战starwar

    Description 很久以前,在一个遥远的星系,一个黑暗的帝国靠着它的超级武器统治者整个星系.某一天,凭着一个偶然的机遇,一支反抗军摧毁了帝国的超级武器,并攻下了星系中几乎所有的星球.这些星球通过 ...

  10. 微软职位内部推荐-Senior NLP Scientist & Developer

    微软近期Open的职位: Contact Person: Winnie Wei (wiwe@microsoft.com )Senior Software Development Engineer/NL ...