A RabbitMQ VHost object.
More...
#include <rmqa_vhost.h>
|
| | VHost (bslma::ManagedPtr< rmqp::Connection > impl) |
| |
|
virtual | ~VHost () |
| | The RabbitMQ connection will be disconnected on this call.
|
| |
| rmqt::Result< Producer > | createProducer (const rmqp::Topology &topology, rmqt::ExchangeHandle exchange, uint16_t maxOutstandingConfirms) |
| | Create a producer using the provided Topology. This method starts the process of declaring the topology, and creating the producer. The returned Future provides access to the Producer when it is ready. More...
|
| |
| rmqt::Result< Consumer > | createConsumer (const rmqp::Topology &topology, rmqt::QueueHandle queue, const rmqp::Consumer::ConsumerFunc &onMessage, const rmqt::ConsumerConfig &config=rmqt::ConsumerConfig()) |
| | Create an asynchronous consumer using the provided Topology. More...
|
| |
| rmqt::Result< Consumer > | createConsumer (const rmqp::Topology &topology, rmqt::QueueHandle queue, const rmqp::Consumer::ConsumerFunc &onMessage, const bsl::string &consumerTag, uint16_t prefetchCount=rmqt::ConsumerConfig::s_defaultPrefetchCount) |
| | Create an asynchronous consumer using the provided Topology. More...
|
| |
|
void | close () |
| | Close the connection to the broker. The connection will not reconnect after this call.
|
| |
A RabbitMQ VHost object.
Represents connections needed to communicate with a vhost on the RabbitMQ broker. Useful to create Producer and Consumer channels/objects. The VHost must live longer than Consumers and Producers created from it.
◆ VHost()
VHost (connections) are constructed by RabbitContext::createVhostConnection
◆ createConsumer() [1/2]
Create an asynchronous consumer using the provided Topology.
- Deprecated:
- Parameters
-
| topology | The RabbitMQ topology which will be declared on the broker with this consumer. |
| queue | The queue to consume from. This queue must be contained within topology. |
| consumerTag | A label for the consumer which is displayed on the RabbitMQ Management UI. It is useful to give this a meaningful name. |
| onMessage | The callback to be invoked on each message. This will be invoked from the RabbitContext threadpool. |
| prefetchCount | Used by the RabbitMQ broker to limit the number of messages held by a consumer at one time. Higher values can increase throughput, particularly in high latency environments. |
- Returns
- A result which will contain either the connected consumer object which has been registered on the Event Loop thread or an error.
- Note
- The VHost object must outlive the Consumer
◆ createConsumer() [2/2]
Create an asynchronous consumer using the provided Topology.
- Parameters
-
| topology | The RabbitMQ topology which will be declared on the broker with this consumer. |
| queue | The queue to consume from. This queue must be contained within topology. |
| onMessage | The callback to be invoked on each message. This will be invoked from the RabbitContext threadpool. |
| config | additional options like the prefetchCount and the consumerTag |
- Returns
- A result which will contain either the connected consumer object which has been registered on the Event Loop thread or an error.
- Note
- The VHost object must outlive the Consumer
◆ createProducer()
Create a producer using the provided Topology. This method starts the process of declaring the topology, and creating the producer. The returned Future provides access to the Producer when it is ready.
- Parameters
-
| topology | The RabbitMQ topology declared by this producer. This topology will be automatically re-declared on reconnection. |
| exchange | The exchange all messages will be published to. This exchange must be contained in topology for the Producer to be successfully created. |
| maxOutstandingConfirms | The maximum number of unconfirmed messages Producer will allow before blocking and waiting for a publisher confirm from the broker. |
- Returns
- A result which will either be a connected producer that has been registered on the Event Loop thread or an error.
- Note
- The VHost object must outlive the Producer
◆ generateConsumerTag()
| bsl::string BloombergLP::rmqa::VHost::generateConsumerTag |
( |
| ) |
|
|
static |
The documentation for this class was generated from the following files: