服务总线的 AMQP 1.0 支持AMQP 1.0 support in Service Bus

Azure 服务总线云服务和本地 Windows Server 服务总线(服务总线 1.1)均支持高级消息队列协议 (AMQP) 1.0。Both the Azure Service Bus cloud service and on-premises Service Bus for Windows Server (Service Bus 1.1) support the Advanced Message Queueing Protocol (AMQP) 1.0. 通过 AMQP 可使用开放标准协议构建跨平台的混合应用程序。AMQP enables you to build cross-platform, hybrid applications using an open standard protocol. 可以借助使用不同语言和框架构建的且运行在不同操作系统上的组件来构建应用程序。You can construct applications using components that are built using different languages and frameworks, and that run on different operating systems. 所有这些组件均可连接到服务总线,并且能够高效且完全无损地无缝交换结构化业务消息。All these components can connect to Service Bus and seamlessly exchange structured business messages efficiently and at full fidelity.

简介:什么是 AMQP 1.0,为何它很重要?Introduction: What is AMQP 1.0 and why is it important?

通常,面向消息的中间件产品始终使用专用协议来支持客户端应用程序和代理之间的通信。Traditionally, message-oriented middleware products have used proprietary protocols for communication between client applications and brokers. 这意味着,在您选择特定供应商的消息传递代理后,您必须使用该供应商的库将您的客户端应用程序连接到该代理。This means that once you've selected a particular vendor's messaging broker, you must use that vendor's libraries to connect your client applications to that broker. 这将导致在一定程度上依赖于该供应商,因为将应用程序传送到其他产品需要对所有已连接应用程序进行代码改写。This results in a degree of dependence on that vendor, since porting an application to a different product requires code changes in all the connected applications.

此外,连接来自不同供应商的消息传递代理比较棘手。Furthermore, connecting messaging brokers from different vendors is tricky. 这通常需要通过应用程序级桥接来将消息从一个系统移到另一个系统,并在其专用消息格式之间进行转换。This typically requires application-level bridging to move messages from one system to another and to translate between their proprietary message formats. 这是一个常见的要求;例如,在必须向较旧的独立系统提供新的统一接口时,或者在合并后集成 IT 系统时。This is a common requirement; for example, when you must provide a new unified interface to older disparate systems, or integrate IT systems following a merger.

软件产业是一个飞速发展的产业;新编程语言和应用程序框架的引入速度有时会非常惊人。The software industry is a fast-moving business; new programming languages and application frameworks are introduced at a sometimes bewildering pace. 同样,IT 系统的要求随着时间不断变化,并且开发人员希望利用最新的平台功能。Similarly, the requirements of IT systems evolve over time and developers want to take advantage of the latest platform features. 但有时候,所选消息传送供应商不支持这些平台。However, sometimes the selected messaging vendor does not support these platforms. 由于使用的是专用消息协议,其他供应商无法为这些新平台提供库。Because messaging protocols are proprietary, it's not possible for others to provide libraries for these new platforms. 因此,必须使用构建网关等手段,或者可让你继续使用消息传递产品的网桥。Therefore, you must use approaches such as building gateways or bridges that enable you to continue to use the messaging product.

这些问题推动了高级消息队列协议 (AMQP) 1.0 的开发。The development of the Advanced Message Queuing Protocol (AMQP) 1.0 was motivated by these issues. 这种协议源于 JP Morgan Chase,像多数金融服务公司一样,该公司大量使用面向消息的中间件。It originated at JP Morgan Chase, who, like most financial services firms, are heavy users of message-oriented middleware. 目标非常简单:就是创建一个开放标准消息传送协议,从而能够借助使用不同语言、框架和操作系统构建的组件来构建基于消息的应用程序,而所有这些应用程序都使用各个供应商提供的同类最佳组件。The goal was simple: to create an open-standard messaging protocol that made it possible to build message-based applications using components built using different languages, frameworks, and operating systems, all using best-of-breed components from a range of suppliers.

AMQP 1.0 技术特性AMQP 1.0 technical features

AMQP 1.0 是一个高效、可靠的线级消息传递协议,可用于构建强大、跨平台的消息传递应用程序。AMQP 1.0 is an efficient, reliable, wire-level messaging protocol that you can use to build robust, cross-platform, messaging applications. 协议有一个简单的目标:定义用于在两方之间安全、可靠且高效传输消息的机制。The protocol has a simple goal: to define the mechanics of the secure, reliable, and efficient transfer of messages between two parties. 这些消息本身使用可移植数据表示进行编码,这种表示支持不同发送者和接收者完全无损地交换结构化业务消息。The messages themselves are encoded using a portable data representation that enables heterogeneous senders and receivers to exchange structured business messages at full fidelity. 下面简要介绍几个最重要的特性:The following is a summary of the most important features:

  • 高效:AMQP 1.0 是一个面向连接的协议,它将二进制编码用于协议指令以及通过该协议传输的业务消息。Efficient: AMQP 1.0 is a connection-oriented protocol that uses a binary encoding for the protocol instructions and the business messages transferred over it. 它融合了复杂的流控制方案,可最大限度地利用网络和已连接组件。It incorporates sophisticated flow-control schemes to maximize the utilization of the network and the connected components. 也就是说,该协议旨在实现有效性、灵活性和互操作性之间的平衡。That said, the protocol was designed to strike a balance between efficiency, flexibility and interoperability.
  • 可靠:使用 AMQP 1.0 协议交换消息时,可以获得一系列可靠性保证(从即发即弃到可靠的恰一次确认传送)。Reliable: The AMQP 1.0 protocol allows messages to be exchanged with a range of reliability guarantees, from fire-and-forget to reliable, exactly-once acknowledged delivery.
  • 灵活:AMQP 1.0 是一个灵活的协议,可用于支持不同的拓扑。Flexible: AMQP 1.0 is a flexible protocol that can be used to support different topologies. 可以将同一协议用于客户端到客户端、客户端到代理以及代理到代理通信。The same protocol can be used for client-to-client, client-to-broker, and broker-to-broker communications.
  • 独立于代理模型:AMQP 1.0 规范对代理所使用的消息传递模型不作任何要求。Broker-model independent: The AMQP 1.0 specification does not make any requirements on the messaging model used by a broker. 这意味着可以向现有消息传送代理中轻松添加 AMQP 1.0 支持。This means that it's possible to easily add AMQP 1.0 support to existing messaging brokers.

AMQP 1.0 是一种标准(带有大写字母“S”)AMQP 1.0 is a Standard (with a capital 'S')

AMQP 1.0 是一种国际标准,已通过 ISO 和 IEC 的认证,认证编号为 ISO/IEC 19464:2014。AMQP 1.0 is an international standard, approved by ISO and IEC as ISO/IEC 19464:2014.

自 2008 年以来,AMQP 1.0 一直由一个由 20 多家公司(包括技术提供商和最终用户企业)组成的核心小组进行开发。AMQP 1.0 has been in development since 2008 by a core group of more than 20 companies, both technology suppliers and end-user firms. 在此期间,用户企业提供其实际业务需求,技术供应商则开发该协议来满足这些需求。During that time, user firms have contributed their real-world business requirements and the technology vendors have evolved the protocol to meet those requirements. 在整个过程中,供应商参加了研讨会,并在会上协作验证了其实现之间的互操作性。Throughout the process, vendors have participated in workshops in which they collaborated to validate the interoperability between their implementations.

2011 年 10 月,开发工作提交给结构化信息标准促进组织 (Organization for the Advancement of Structured Information Standards,OASIS) 内的技术委员会,随后 OASIS AMQP 1.0 标准于 2012 年 10 月发布。In October 2011, the development work transitioned to a technical committee within the Organization for the Advancement of Structured Information Standards (OASIS) and the OASIS AMQP 1.0 Standard was released in October 2012. 在开发该标准期间,以下公司参与了技术委员会的工作:The following firms participated in the technical committee during the development of the standard:

  • 技术供应商:Axway Software、Huawei Technologies、IIT Software、INETCO Systems、Kaazing、Microsoft、Mitre Corporation、Primeton Technologies、Progress Software、Red Hat、SITA、Software AG、Solace Systems、VMware、WSO2、Zenika。Technology vendors: Axway Software, Huawei Technologies, IIT Software, INETCO Systems, Kaazing, Microsoft, Mitre Corporation, Primeton Technologies, Progress Software, Red Hat, SITA, Software AG, Solace Systems, VMware, WSO2, Zenika.
  • 企业用户:Bank of America、Credit Suisse、Deutsche Boerse、Goldman Sachs、JPMorgan Chase。User firms: Bank of America, Credit Suisse, Deutsche Boerse, Goldman Sachs, JPMorgan Chase.

开放标准的公认好处包括:Some of the commonly cited benefits of open standards include:

  • 供应商锁定的几率较低Less chance of vendor lock-in
  • 互操作性Interoperability
  • 有大量库和工具可供使用Broad availability of libraries and tooling
  • 不会过时Protection against obsolescence
  • 随时可找到知识渊博的工作人员Availability of knowledgeable staff
  • 风险较低且可控Lower and manageable risk

AMQP 1.0 和 Service BusAMQP 1.0 and Service Bus

Azure 服务总线中对 AMQP 1.0 的支持意味着现在可以通过一系列使用有效的二进制协议的平台利用队列和发布/订阅中转消息传送功能。AMQP 1.0 support in Azure Service Bus means that you can now leverage the Service Bus queuing and publish/subscribe brokered messaging features from a range of platforms using an efficient binary protocol. 此外,还可以生成由结合使用多个语言、框架和操作系统构建的组件组成的应用程序。Furthermore, you can build applications comprised of components built using a mix of languages, frameworks, and operating systems.

下图显示了一个部署示例,其中 Java 客户端运行在 Linux 上,并使用标准 Java 消息服务 (JMS) API 写入数据;而 .NET 客户端运行在 Windows 上,并使用 AMQP 1.0 通过服务总线交换消息。The following figure illustrates an example deployment in which Java clients running on Linux, written using the standard Java Message Service (JMS) API and .NET clients running on Windows, exchange messages via Service Bus using AMQP 1.0.

图 1:演示使用服务总线和 AMQP 1.0 进行跨平台消息传送的部署方案示例Figure 1: Example deployment scenario showing cross-platform messaging using Service Bus and AMQP 1.0

当前,已知下列客户端库使用服务总线:At this time the following client libraries are known to work with Service Bus:

语言Language Library
JavaJava Apache Qpid Java 消息服务 (JMS) 客户端Apache Qpid Java Message Service (JMS) client
软件 SwiftMQ IIT Java 客户端IIT Software SwiftMQ Java client
CC Apache Qpid Proton-CApache Qpid Proton-C
PHPPHP Apache Qpid Proton-PHPApache Qpid Proton-PHP
PythonPython Apache Qpid Proton-PythonApache Qpid Proton-Python
C#C# AMQP .Net LiteAMQP .Net Lite

图 2:AMQP 1.0 客户端库表Figure 2: Table of AMQP 1.0 client libraries

摘要Summary

  • AMQP 1.0 是一个开放、可靠的消息传递协议,可用于构建跨平台的混合应用程序。AMQP 1.0 is an open, reliable messaging protocol that you can use to build cross-platform, hybrid applications. AMQP 1.0 是一种 OASIS 标准。AMQP 1.0 is an OASIS standard.
  • Azure 服务总线和 Windows Server 服务总线(服务总线 1.1)都支持 AMQP 1.0。AMQP 1.0 support is now available in Azure Service Bus as well as Service Bus for Windows Server (Service Bus 1.1). 定价与现有协议相同。Pricing is the same as for the existing protocols.

后续步骤Next steps

准备好了解详细信息?Ready to learn more? 请访问以下链接:Visit the following links: