RMQ - RabbitMQ C++ Library
Public Member Functions | List of all members
BloombergLP::rmqp::Topology Class Referenceabstract

An interface providing a manipulatable RabbitMQ topology structure. More...

#include <rmqp_topology.h>

Inheritance diagram for BloombergLP::rmqp::Topology:
Inheritance graph
[legend]

Public Member Functions

virtual rmqt::QueueHandle addQueue (const bsl::string &name=bsl::string(), rmqt::AutoDelete::Value=rmqt::AutoDelete::OFF, rmqt::Durable::Value=rmqt::Durable::ON, const rmqt::FieldTable &args=rmqt::FieldTable())=0
 Declare a queue. More...
 
virtual rmqt::ExchangeHandle addExchange (const bsl::string &name, const rmqt::ExchangeType &exchangeType=rmqt::ExchangeType::DIRECT, rmqt::AutoDelete::Value autoDelete=rmqt::AutoDelete::OFF, rmqt::Durable::Value durable=rmqt::Durable::ON, rmqt::Internal::Value internal=rmqt::Internal::NO, const rmqt::FieldTable &args=rmqt::FieldTable())=0
 Declare an exchange. More...
 
virtual rmqt::ExchangeHandle addPassiveExchange (const bsl::string &name)=0
 Declare a dependency on Exchange (without creating it) More...
 
virtual rmqt::QueueHandle addPassiveQueue (const bsl::string &name)=0
 Declare a dependency on Queue (without creating it) More...
 
virtual void bind (const rmqt::ExchangeHandle &exchangeName, const rmqt::QueueHandle &queue, const bsl::string &bindingKey, const rmqt::FieldTable &args=rmqt::FieldTable())=0
 Bind a queue and an exchange. More...
 
virtual void bind (const rmqt::ExchangeHandle &exchange1, const rmqt::ExchangeHandle &exchange2, const bsl::string &bindingKey, const rmqt::FieldTable &args=rmqt::FieldTable())=0
 Bind two exchanges. More...
 
virtual const rmqt::Topologytopology () const =0
 Get a readonly copy of stored topology. More...
 
virtual const rmqt::ExchangeHandle defaultExchange ()=0
 Retrieve a handle for the default exchange. More...
 

Detailed Description

An interface providing a manipulatable RabbitMQ topology structure.

Represents the RabbitMQ topology, allowing declaring of Exchanges, Queues, and Bindings. This object is passed to rmqa::VHost when creating Producers and Consumers, which ensure this topology is available on the broker.

Member Function Documentation

◆ addExchange()

virtual rmqt::ExchangeHandle BloombergLP::rmqp::Topology::addExchange ( const bsl::string &  name,
const rmqt::ExchangeType exchangeType = rmqt::ExchangeType::DIRECT,
rmqt::AutoDelete::Value  autoDelete = rmqt::AutoDelete::OFF,
rmqt::Durable::Value  durable = rmqt::Durable::ON,
rmqt::Internal::Value  internal = rmqt::Internal::NO,
const rmqt::FieldTable args = rmqt::FieldTable() 
)
pure virtual

Declare an exchange.

Parameters
nameExchange name. Maximum allowed length is 127 characters. See https://www.rabbitmq.com/amqp-0-9-1-reference.html#exchange.declare.exchange for name rules.
exchangeTypeThe exchange type drives the meaning of the routingKey when publishing to an exchange.
autoDeleteWhen ON the exchange is deleted after all bindings are removed.
durableWhen ON the exchange declaration will survive broker restarts
internalWhen YES the exchange is declared as an internal. Internal exchange cannot be used directly by publishers. It can be used, when bound to other exchange.
argsFurther Exchange properties are controlled by key-value properties defined in an rmqt::FieldTable.
Returns
ExchangeHandle which can later be used in producers/consumers. The result type has pointer semantics and does not pass the ownership to the caller.

Implemented in BloombergLP::rmqa::Topology.

◆ addPassiveExchange()

virtual rmqt::ExchangeHandle BloombergLP::rmqp::Topology::addPassiveExchange ( const bsl::string &  name)
pure virtual

Declare a dependency on Exchange (without creating it)

Parameters
nameExchange name.
Returns
ExchangeHandle which can later be used in producers/consumers. The result type has pointer semantics and does not pass the ownership to the caller.

Implemented in BloombergLP::rmqa::Topology.

◆ addPassiveQueue()

virtual rmqt::QueueHandle BloombergLP::rmqp::Topology::addPassiveQueue ( const bsl::string &  name)
pure virtual

Declare a dependency on Queue (without creating it)

Parameters
nameQueue name.
Returns
QueueHandle which can later be used in producers/consumers. The result type has pointer semantics and does not pass the ownership to the caller.

Implemented in BloombergLP::rmqa::Topology.

◆ addQueue()

virtual rmqt::QueueHandle BloombergLP::rmqp::Topology::addQueue ( const bsl::string &  name = bsl::string(),
rmqt::AutoDelete::Value  = rmqt::AutoDelete::OFF,
rmqt::Durable::Value  = rmqt::Durable::ON,
const rmqt::FieldTable args = rmqt::FieldTable() 
)
pure virtual

Declare a queue.

Parameters
nameQueue Name. See https://www.rabbitmq.com/queues.html#names for name rules.
autoDeleteNot recommended When ON the queue is declared as autodelete. An autodelete queue is deleted when it's last consumer is cancelled. This could cause data loss if all consumers are disconnected in an outage.
durableWhen ON the queue declaration will survive broker restarts. Persistent messages will also survive broker restart in the queue. Message persistence is controlled by the publisher.
argsOther queue properties (such as TTL) are controlled by key-value properties held in a rmqt::FieldTable.
Returns
QueueHandle which can be later used in producers/consumers. The result type has pointer semantics and does not pass the ownership to the caller.

Implemented in BloombergLP::rmqa::Topology.

◆ bind() [1/2]

virtual void BloombergLP::rmqp::Topology::bind ( const rmqt::ExchangeHandle &  exchange1,
const rmqt::ExchangeHandle &  exchange2,
const bsl::string &  bindingKey,
const rmqt::FieldTable args = rmqt::FieldTable() 
)
pure virtual

Bind two exchanges.

Implemented in BloombergLP::rmqa::Topology.

◆ bind() [2/2]

virtual void BloombergLP::rmqp::Topology::bind ( const rmqt::ExchangeHandle &  exchangeName,
const rmqt::QueueHandle &  queue,
const bsl::string &  bindingKey,
const rmqt::FieldTable args = rmqt::FieldTable() 
)
pure virtual

Bind a queue and an exchange.

Implemented in BloombergLP::rmqa::Topology.

◆ defaultExchange()

virtual const rmqt::ExchangeHandle BloombergLP::rmqp::Topology::defaultExchange ( )
pure virtual

Retrieve a handle for the default exchange.

The default exchange is an exchange named '' (length 0). It is a DIRECT exchange with automatic bindings for all queues within the vhost

Implemented in BloombergLP::rmqa::Topology.

◆ topology()

virtual const rmqt::Topology & BloombergLP::rmqp::Topology::topology ( ) const
pure virtual

Get a readonly copy of stored topology.

This is used internally by rmqamqp to send the topology to the broker

Implemented in BloombergLP::rmqa::Topology.


The documentation for this class was generated from the following files: