Advanced Message Queuing Protocol ( 1 ) 概述

The Advanced Message Queuing Protocol (AMQP) 是一个标准开放的应用层的消息中间件( Message Oriented Middleware )协议。 AMQP 定义了通过网络发送的字节流的数据格式。因此兼容性非常好,任何实现 AMQP 协议的程序都可以和与 AMQP 协议兼容的其他程序交互,可以很容易做到跨语言,跨平台。

 


Development

AMQP JPMorgan Chase & Co 2006 年中旬发布。 JPMorgan Chase & Co iMatix 定义协议规范,并由包括 Red Hat, Cisco Systems, TWIST, IONA, and iMatix 参与开发。截至 2009 11 月,工作组的成员包括 Bank of America, Barclays, Cisco Systems, Credit Suisse, Deutsche B ö rse Systems, Envoy Technologies, Inc., Goldman Sachs, Progress Software, iMatix Corporation, JPMorgan Chase Bank Inc. N.A, Microsoft Corporation, Novell, Rabbit Technologies Ltd., Red Hat, Inc., Solace Systems, Tervela Inc., TWIST Process Innovations ltd, WS02 and 29West Inc.

值得一提的是, AMQP 的设计目标是建立开放工业标准协议。虽然 AMQP 的起源于金融服务行业,但是它的用途并不局限于金融行业内。


The AMQP model


分布式模型 

 

AMQP 定义了一系列实体 Entity , 从连接的角度来看 , 他们是

Message Broker 连接 Client 的服务器,他使用 AMQP 协议与 Client 交互,并且可以作为集群运行, 但是这些细节并没有写入 AMQP 的规范。

User: 用户可以连接到 Message Broker

Connection: 物理连接 , 绑定到用户

Channel Channel 是有状态的逻辑连接。 Client 连接上执行并行操作应维护不同的 Channel

所有发送和接收的实体( Entity )都在 Channel 中定义。任何试图声明一个已具名的有不同属性的实体( Entity , 都将导致错误。如果需要改变实体( Entity )的属性, 必须先将该实体删除,之后重新定义。实体( Entity )名字必须唯一, Broker 根据实体( Entity )名字来判断 Client 的操作权限。


Exchanges

Exchange Client 接收消息,并把它们分发到 Message Queue

Exchange 的属性

passive:   Exchange 不必被声明,但是如果不存在,将会产生错误

durable :如果 Broker 重起, Exchange 是否还有效

auto-delete :只要发现它没有被绑定到 Queue Exchange 将被删除。

 

Queues

Queue 用于存放 Message ,直到有客户端可以处理这个 Message

Queue 的属性

alternate-Exchange :当信息被拒绝接收,将转发到这个 Exchange ,并从 Queue 中删除。

passive: Queue 不必被声明, 但是如果不存在, 将会产生错误

durable :如果 Broker 重起, Queue 是否还有效

exclusive :只能有一个 Client 一个具体的 Queue

auto-delete :如果 Queue 未被订阅, 则自动删除 Queue

 

Messages

Message 一律不具名,并被发送到 Exchange 。它们由一个 Message header Message content 的构成。 body 是一个包含若干可选的属性的不可见的 Message header

routing-key :这个属性取决于 Exchange 的类型

immediate :如果 Message 不能立即被处理, 则将其视为 unroutable

delivery-mode :表明该 Message 是否需要持久保存。

priority Message 的优先级

expiration: Message 多久之后失效, 之后将作为 unroutable 处理

 

Bindings

Binding 是一个 Queue Exchange 的逻辑绑定,并指定一个 Message 如何从 Exchange 发送到 Queue

Unconditional :请求 Exchange 的所有的 Message

Conditional on a fixed string :请求 Exchange 上具有指定 routing key 的所有 Message

Conditional on a pattern match 请求 Exchange 上具有指定 routing key 并且符合指定 pattern 的所有 Message

Conditional on multiple fixed strings :请求 Exchange 上属性符合要求的所有 Message

Conditional on multiple fixed strings :请求 Exchange 上模式符合要求的所有 Message

Conditional on algorithmic comparison :请求 Exchange 上符合算法要求的所有 Message

Conditional on content inspection :请求 Exchange 上内容符合要求的所有 Message

 

Implementations

These are the known publicly available AMQP implementations:

OpenAMQ, original open-source implementation of AMQP, written in C by iMatix. Runs on Linux, AIX, Solaris, Windows, OpenVMS. Includes Broker, APIs in C/C++ and Java JMS, remote admin shell, scripting, federation, failover, and AMQP-over-HTTP via the RestMS protocol.

Apache Qpid, a project in the Apache Foundation with Client APIs that support C++, Ruby, Java, JMS, Python and .NET.

Red Hat Enterprise MRG implements the latest version of AMQP 0-10 providing rich set of features like full management, federation, Active-Active clustering using Qpid as upstream, adds a web console and many enterprise features and "C++, Ruby, Java, JMS, Python .NET" Clients.

RabbitMQ, an independent open-source implementation. The server is written in Erlang, and multiple Clients including Python, Ruby, .NET, Java, JMS, C, PHP, Actionscript, XMPP, STOMP, and AJAX are provided. RabbitMQ is distributed with Ubuntu, FreeBSD ports.

AMQP Infrastructure yum installable AMQP 0-10 (maintained in the latest 3 versions of Fedora) which includes the Broker, management tools, agents and Clients.

ØMQ, a high-performance messaging platform that is able to treat AMQP-compliant Brokers as nodes in distributed messaging network.

Zyre, a Broker that implements RestMS and AMQP to provide RESTful HTTP access to AMQP networks.

 


reference:

http://en.wikipedia.org/wiki/Advanced_Message_Queuing_Protocol

分类: Network
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值