[openstack-dev] [marconi] RabbitMQ (AMQP 0.9) driver for Marconi

Janczuk, Tomasz tomasz.janczuk at hp.com
Tue Jun 10 18:12:46 UTC 2014

I the last few days I attempted to implement a RabbitMQ (AMQP 0.9) storage driver for Marconi. These are the take-aways from this experiment. High level, it showed that current Marconi APIs *cannot* be mapped onto the AMQP 0.9 abstractions. In fact, currently it is not even possible to support a subset of functionality that would allow both message publication and consumption.

  1.  Marconi exposes HTTP APIs that allow messages to be listed without consuming them. This API cannot be implemented on top of AMQP 0.9 which implements a strict queueing semantics.

  2.  Marconi exposes HTTP APIs that allow random access to messages by ID. This API cannot be implemented on top of AMQP 0.9 which does not allow random access to messages, and the message ID concept is not present in the model.

  3.  Marconi exposes HTTP APIs that allow queues to be created, deleted, and listed. Queue creation and deletion can be implemented with AMQP 0.9, but listing queues is not possible with AMQP. However, listing queues can be implemented by accessing RabbitMQ management plugin over proprietary HTTP APIs that Rabbit exposes.

  4.  Marconi message publishing APIs return server-assigned message IDs. Message IDs are absent from the AMQP 0.9 model and so the result of message publication cannot provide them.

  5.  Marconi message consumption API creates a “claim ID” for a set of consumed messages, up to a limit. In the AMQP 0.9 model (as well as SQS and Azure Queues), “claim ID” maps onto the concept of “delivery tag” which has a 1-1 relationship with a message. Since there is no way to represent the 1-N mapping between claimID and messages in the AMQP 0.9 model, it effectively restrict consumption of messages to one per claimID. This in turn prevents batch consumption benefits.

  6.  Marconi message consumption acknowledgment requires both claimID and messageID to be provided. MessageID concept is missing in AMQP 0.9. In order to implement this API, assuming the artificial 1-1 restriction of claim-message mapping from #5 above, this API could be implemented by requiring that messageID === claimID. This is really a workaround.

  7.  RabbitMQ message acknowledgment MUST be sent over the same AMQP channel instance on which the message was originally received. This requires that the two Marconi HTTP calls that receive and acknowledge a message are affinitized to the same Marconi backend. It either substantially complicates driver implementation (server-side reverse proxing of requests) or adds new requirements onto the Marconi deployment (server affinity through load balancing).

  8.  Currently Marconi does not support an HTTP API that allows a message to be consumed with immediate acknowledgement (such API is in the pipeline however). Despite the fact that such API would not even support the at-least-once guarantee, combined with the restriction from #7 it means that there is simply *no way* currently for a RabbitMQ based driver to implement any form of message consumption using today’s HTTP API.

If Marconi aspires to support a range of implementation choices for the HTTP APIs it prescribes, the HTTP APIs will likely need to be re-factored and simplified. Key issues are related to the APIs that allow messages to be looked up without consuming them, the explicit modeling of message IDs (unnecessary in systems with strict queuing semantics), and the acknowledgment (claim) model that is different from most acknowledgments models out there (SQS, Azure Queues, AMQP).

I believe Marconi would benefit from a small set of core HTTP APIs that reflect a strict messaging semantics, providing a scenario parity with SQS or Azure Storage Queues.

Tomasz Janczuk

More information about the OpenStack-dev mailing list