#include <Exchange.h>
Public Member Functions | |
Exchange (std::string name, std::string type=DIRECT_EXCHANGE) | |
const std::string & | getName () const |
const std::string & | getType () const |
Static Public Attributes | |
static const std::string | DIRECT_EXCHANGE |
A direct exchange routes messages published with routing key X to any queue bound with key X (i.e. | |
static const std::string | TOPIC_EXCHANGE |
A topic exchange treats the key with which a queue is bound as a pattern and routes all messages whose routing keys match that pattern to the bound queue. | |
static const std::string | XML_EXCHANGE |
static const std::string | HEADERS_EXCHANGE |
The headers exchange routes messages based on whether their headers match the binding arguments specified when binding. | |
static const Exchange | DEFAULT_EXCHANGE |
The 'default' exchange, nameless and of type 'direct', has every declared queue bound to it by name. | |
static const Exchange | STANDARD_DIRECT_EXCHANGE |
The standard direct exchange, named amq.direct. | |
static const Exchange | STANDARD_TOPIC_EXCHANGE |
The standard topic exchange, named amq.topic. | |
static const Exchange | STANDARD_HEADERS_EXCHANGE |
The standard headers exchange, named amq.header. |
A 'handle' used to represent an AMQP exchange in the Channel methods. Exchanges are the destinations to which messages are published.
There are different types of exchange (the standard types are available as static constants, see DIRECT_EXCHANGE, TOPIC_EXCHANGE and HEADERS_EXCHANGE). A Queue can be bound to an exchange using Channel::bind() and messages published to that exchange are then routed to the queue based on the details of the binding and the type of exchange.
There are some standard exchange instances that are predeclared on all AMQP brokers. These are defined as static members STANDARD_DIRECT_EXCHANGE, STANDARD_TOPIC_EXCHANGE and STANDARD_HEADERS_EXCHANGE. There is also the 'default' exchange (member DEFAULT_EXCHANGE) which is nameless and of type 'direct' and has every declared queue bound to it by queue name.
const std::string qpid::client::Exchange::DIRECT_EXCHANGE [static] |
A direct exchange routes messages published with routing key X to any queue bound with key X (i.e.
an exact match is used).
const std::string qpid::client::Exchange::TOPIC_EXCHANGE [static] |
A topic exchange treats the key with which a queue is bound as a pattern and routes all messages whose routing keys match that pattern to the bound queue.
The routing key for a message must consist of zero or more alpha-numeric words delimited by dots. The pattern is of a similar form, but * can be used to match exactly one word and # can be used to match zero or more words.
const std::string qpid::client::Exchange::HEADERS_EXCHANGE [static] |
The headers exchange routes messages based on whether their headers match the binding arguments specified when binding.
(see the AMQP spec for more details).