17#ifndef INCLUDED_RMQA_VHOSTIMPL
18#define INCLUDED_RMQA_VHOSTIMPL
20#include <rmqp_connection.h>
21#include <rmqp_consumer.h>
22#include <rmqp_producer.h>
23#include <rmqt_topology.h>
25#include <bsl_functional.h>
26#include <bslma_managedptr.h>
27#include <bslmt_mutex.h>
29namespace BloombergLP {
36 typedef bsl::function<rmqt::Future<rmqp::Connection>(
37 const bsl::string& suffix)>
40 explicit VHostImpl(
const ConnectionMaker& connectionMaker);
44 rmqt::ExchangeHandle exchange,
45 uint16_t maxOutstandingConfirms) BSLS_KEYWORD_OVERRIDE;
49 rmqt::QueueHandle queue,
55 rmqt::ExchangeHandle exchange,
56 uint16_t maxOutstandingConfirms) BSLS_KEYWORD_OVERRIDE;
60 rmqt::QueueHandle queue,
64 void close() BSLS_KEYWORD_OVERRIDE;
67 ConnectionMaker d_newConnection;
68 bslmt::Mutex d_connectionMutex;
69 bslma::ManagedPtr<rmqt::Future<rmqp::Connection> > d_consumerFuture;
70 bslma::ManagedPtr<rmqt::Future<rmqp::Connection> > d_producerFuture;
A RabbitMQ VHost Implementation of the rmqp::Connection interface.
Definition: rmqa_vhostimpl.h:34
rmqt::Result< rmqp::Producer > createProducer(const rmqt::Topology &topology, rmqt::ExchangeHandle exchange, uint16_t maxOutstandingConfirms) BSLS_KEYWORD_OVERRIDE
Definition: rmqa_vhostimpl.cpp:71
void close() BSLS_KEYWORD_OVERRIDE
Flush all data pending and then close the connection. Close the connection and invalidates all consum...
Definition: rmqa_vhostimpl.cpp:135
rmqt::Result< rmqp::Consumer > createConsumer(const rmqt::Topology &topology, rmqt::QueueHandle queue, const rmqp::Consumer::ConsumerFunc &onMessage, const rmqt::ConsumerConfig &config) BSLS_KEYWORD_OVERRIDE
Create an asynchronous consumer using the provided Topology.
Definition: rmqa_vhostimpl.cpp:80
Provide a RabbitMQ Connection API.
Definition: rmqp_connection.h:42
bsl::function< void(rmqp::MessageGuard &)> ConsumerFunc
Callback function used to receive messages.
Definition: rmqp_consumer.h:48
Class for passing arguments to Consumer.
Definition: rmqt_consumerconfig.h:42
An async-style Future/Promise object.
Definition: rmqt_future.h:108
A result of an operation.
Definition: rmqt_result.h:37
Definition: rmqt_topology.h:32