You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 11 Next »

This page is a collection of FAQ and How to-s for Qpid. If you have a question, post it to the users list and we will place the answer here to build out our FAQ/ How to.

FAQ

About AMQP

What is AMQP?

AMQP is a wire-level protocol and model for high performance enterprise messaging.

From the AMQP website:

AMQP is an Open Standard for Messaging Middleware.

By complying to the AMQP standard, middleware products written for different platforms and in different languages can send messages to one another. AMQP addresses the problem of transporting value-bearing messages across and between organizations in a timely manner.

AMQP enables complete interoperability for messaging middleware; both the networking protocol and the semantics of broker services are defined in AMQP.

Where did AMQP come from

AMQP was born out from Frustration by John O'Hara at JPMC. He started a project internally to create commodity messaging that was easy to use. Carl Trieloff from Red Hat had started a project to build messaging for both users and for use in infrastructure, while looking around spoke to John about his work. Out of these discussion was born the AMQP working Group with 6 initial members, under an agreement that it will be eternally be licensed for everyone to use.

Since then the Working Group has had many join, and has been making solid progress working on revisions of the specification. For more details see.

Why use AMQP?

AMQP is has been designed to be able to handle the hardest workloads, scale to the largest systems, but also deal with reduction of change and maintenance costs by doing a refresh on many aged practices. The specification is also not language specific allowing the freedom from language and platform lock in, without compromise on user experience, security, scalability and consistently excellent performance.

Text mostly taken from

Qpid & AMQP

Is Qpid AMQP Compliant?

Yes, Apache Qpid implements the latest AMQP specifications, providing transaction management, queuing, distribution, security, management, clustering, federation and heterogeneous multi-platform support and a lot more. And Apache Qpid is extremely fast. Apache Qpid aims to be 100% AMQP Compliant.

What Client support does Qpid have?

Apache Qpid provides AMQP Client APIs for the following languages:

  • C++
  • C# .NET, using WCF
  • Ruby
  • Python
  • Java JMS, fully conformant with Java CTS1.1

If you need another client, join the lists and ask or feel free to contribute one.

What messaging topologies are supported by AMQP and Qpid?

AMQP provides the ability to do Point-to-Point, Peer-to-Peer, Pub-Sub, and Eventing. This allows many patterns to be craeted:

Point-to-point

This is one of the simplest use-cases. AMQP allows for this in a few ways.
a.) A client can create a named queue allowing the producer to publish the message to the direct exchange with the key mapping the queue name. This will route the message to that queue.
b.) The above pattern can be extended by specifying a reply-to address in the published messages allowing for the consumer to reply the producer without knowing who it was send from prior to receiving the message.

One-to-many

There are a few patterns that can be used.

a.) AMQP provides a 'fanout' exchange which will send a message to all the queues that have been bound to it. Different domains or topics are created with the 'fanout' exchange by declaring different named fan-out exchanges.

b.) A 'topic' or 'headers' exchange can also be used. in this case the pattern match is used to send the message to all the bound queues. It can be thought of as a filter allowing you to create just about any One-to-many routing patterns.

Pub-Sub

Topic can be created with the 'topic' or other 'direct' exchange to allow consumer to bind to into the steams of data they care about. This pattern combined with the use of reply-to and Alternate-routing is the staple of what most people use messaging for today.

FAST Reliable Messaging

AMQP 0-10 allows for fully reliable transfers between any two peers. This means that you can publish or subscribe to the broker fully reliable without requiring the need for transactions. This can all be done in async mode with the C++ broker allowing for high throughput while running entirely reliable.

Transactional

AMQP supports two types of transactions in AMQP 0-10, TX and DTX. This allows for local (1PC), and 2PC transaction and the ability to coordinate with a TM (Transaction Manager). The Java broker supports TX, the C++ broker support TX, DTX, XA, JTA for fully ACID transactions. This allows you to commit a single unit of work with may contain enqueues & dequeues either locally on the broker, or in coordination with other transactional resource like RDBMS.

Transient message delivery

By default messages are transient. Transient message can be sent to queues that are durable. They will not be safe stored or recovered, and will perform as any other transient message - fast!

Durable message delivery

There is a header on each message where the message properties are specified, one of these is durability. Messages that are marked as durable and published to a durable queue will be safe stored. Durable messages will survive restart of the broker or cluster.

Federation (Hub-spoke, Trees, graphs)

As AMQP 0-10 is symmetric for peer-to-peer communication all the building block are in place for creating networks of brokers. The C++ broker allows you to link the brokers together using 'qpid-route' and then create routes between the brokers either statically or with dynamic routes.

This allows for a message to be published to one broker and consumed from another broker in the federated broker network. This feature is great to create data-center, or project isolation, but allow cross communication. It also allows networks to be created to scaled. For more details see

And many others, including custom pattern

Message Reply, Rings, Initial Value Caches, Last Value Messaging

All the above cases can be constructed using the AMQP and features of Qpid. For example reply can be constructed using message browsing and setting TTL on the messages. The C++ broker also support ring queues, last value queues, initial value caches on exchanges. With a bit of throught many additional patterns can be constructed.

Store-and-forward

Store-and-forward can be achieved by publishing to well know durable queues, that are not marked with auto delete. Consumers will be able to 'came back' to consume then at any time, even after restarts.

Security

What encryption does Qpid support?

  • Qpid support SSL/TSL as per the AMQP specification.
  • In addition the C++ broker supports Kerberos encryption of messages independent on which transport is used. Support in not yet included in all clients for this but is in process.

What authentication does Qpid support?

SASL Authentication is supported. All Clients support PLAIN, and Kerberos support if being added to all the clients. The C++ broker support Kerberbos authentication.

What authorization does Qpid support?

Full ACL is supported in the brokers. For details on configuring ACL see.

ACL supports realms and allows for granular permission to be set on all the broker actions including management on an user or group basis.

Performance

Does Qpid Perform (Latency/Throughput)?

Yes, The Qpid C++ broker has been achieved great benchmark results in published papers by those that redistribute it. Red Hat MRG product build on Qpid has shown 760,000msg/sec ingress on an 8 way box or 6,000,000msg/sec OPRA messages.

Latencies have been recored as low as 180-250us (.18ms-.3ms) for TCP round trip and 60-80us for RDMA round trip using the C++ broker.

How To

How to use RDMA with Qpid

The RDMA plugin uses native OFED1.3 and puts AMQP directly onto the DMA. When using the RDMA plug-in for Qpid note the following

  • IP over IB or Fibre needs to be setup for the initial negociation
  • You need to make sure you have enough memory to pin for DMA use ulimit -l something large
  • you might need to edit /etc/security/limits.conf first then log in again

Once you have it up and running, use latencytest to make sure it is working. You should see latencies between 50 and 80us round trip.

Message TTL, auto expire

I need to be able to set time for a message that I send to be removed from the queue if it is not read by my subscriber. For example: I enqueue a message and I want it to be automatically dequeued after a certain amount of time has passed.Is there a feature like this in qpid?

yes, the TTL can be set in the message headers and the messages get dequeued if TTL expires

E.g. from c++:

Message m("Hello World!");
    m.getDeliveryProperties().setTtl(500);

Sets a 500 millisecond timeout.

How to install the qpid-tools for c++ booker?

I see

[commands]$ ./qpid-queue-stats
 Traceback (most recent call last):
 File "./qpid-queue-stats", line 29, in
 from qmf.console import Session, Console
 ImportError: No module named qmf.console 

This problem occurs because the PYTHONPATH environment variable does not include the location of the qpid python files. If you are running from the SVN checkout, add <path>/qpid/python to PYTHONPATH (where <path> is the location of your SVN tree). If you are installing from source, make sure you configure with the same prefix where Python is installed. This is most likely:

# configure --prefix=/usr
# make
# make install

If you are running from vendor RPMs, this should work automatically.

  • No labels