In August 2011 the AMQP Working Group passed the reins to the newly formed OASIS AMQP Member Section. After being developed in a very pragmatic manner by a consortium of “financial service institutions, infrastructure providers, and integration, transaction and networking specialists” (sic), the AMQP protocol became a internationally recognized standard.
A few months later, the final version of the AMQP 1.0 protocol was published. Though it may seem like a tiny increment from the previous version (0-9-1), the latest version of the protocol actually went through some major changes. So let’s go for a quick rundown of these changes.
According to the AMQP website, the version 1.0 of the protocol offers:
- efficient wire protocol,
- support multiple brokers,
- message security,
- global addressing,
- extensible layering,
- supports multiple middleware standards.
All this sounds pretty nifty but how does it impact you as an end user experienced with pre-1.0 AMQP? Read on to find more.
The first and foremost difference is that AMQP 1.0 focuses on the messaging layer only. All attempts to define a broker model have been removed. Focus is a good thing but one can consider that somewhat the protocol has lost some of its teeth. On the other hand, by removing any broker related concerns, the door is now open to any kind of implementation, whatever the semantics of their message routing and handling. Messaging interoperability with strong support for transactions and security is now achievable.
In that matter, the most prominent loss is the notion of exchange, and with it the notions of exchange types (direct, fanout, topic…).
Unlike, JMS where publishers need to know if they deal with a queue or a topic, pre-1.0 AMQP was relying on exchanges, a neutral destination that could, behind the scene, have been consumed by a single queue or many of them, with simple or complex routing policies.
In practice the problem was the following: exchanges, like queues, can be configured to auto-delete themselves when all consumers and produces have disappeared. This could have led to errors for producers in the case the targeted exchange was gone. Because the exchange creation is an idempotent operation, it became a common practice for publishers to create exchanges the same way consumers did. For this they needed to know a lot about the actual nature of the exchange, the way it routed messages, etc… a knowledge that should have been limited to the receiving end was now invading the producing end.
So exchanges have been removed from AMQP 1.0. Instead producers and consumers (which are now called “links”) now interact respectively with targets and sources. These are abstract concepts that encapsulate an address and extra properties.
With the introduction of addresses, the notion of routing key has been removed. Instead an opaque “subject” header has been added, header whose interpretation also varies for each broker.
To illustrate this, let’s look at how RabbitMQ interprets “address” and “subject” in order to bind it to its actual broker implementation that directly comes from AMQP 0-9-1, and this from a publisher standpoint:
|Target||Subject||AMQP 0-9-1 equivalent|
|/exchange/X||RK||Publish to exchange X with routing key RK|
|/queue||Q||Publish to default exchange with routing key Q|
|/queue/Q||ignored||Publish to default exchange with routing key Q|
From a consumer standpoint, “subject” is ignored altogether:
|Source||AMQP 0-9-1 equivalent|
|/queue/Q||Consume from queue Q|
|/exchange/X||Declare a private queue, bind it to exchange X, and consume from it.|
Using one the RabbitMQ administration tools, like the web console or the CLI, is now required to configure the necessary exchanges and queues prior to using them.
So how are all these changes affecting your favorite integration broker?
The Mule transport for AMQP currently supports version 0-9-1 of the protocol. This allows the transport to be used with several existing AMQP servers, like the very popular RabbitMQ and Apache Qpid. We think that AMQP is being called to play a major role in the future, thus we will work to support version 1.0 of the protocol in the near future so that Mule can be used with AMQP to take web messaging to the next level.
What’s your take on this? Were you waiting for AMQP to reach 1.0 before considering it?
Please share your insights in the comment section.