17#ifndef INCLUDED_RMQA_CONNECTIONIMPL
18#define INCLUDED_RMQA_CONNECTIONIMPL
20#include <rmqa_consumer.h>
21#include <rmqa_consumerimpl.h>
22#include <rmqa_producerimpl.h>
24#include <rmqamqp_connection.h>
26#include <rmqio_eventloop.h>
27#include <rmqio_resolver.h>
29#include <rmqp_connection.h>
30#include <rmqp_consumer.h>
31#include <rmqp_producer.h>
33#include <rmqt_credentials.h>
34#include <rmqt_endpoint.h>
35#include <rmqt_future.h>
36#include <rmqt_properties.h>
37#include <rmqt_result.h>
39#include <bdlmt_threadpool.h>
40#include <bslma_managedptr.h>
41#include <bsls_keyword.h>
43#include <bsl_functional.h>
44#include <bsl_memory.h>
45#include <bsl_string.h>
52namespace BloombergLP {
56 public bsl::enable_shared_from_this<ConnectionImpl> {
58 static bsl::shared_ptr<rmqa::ConnectionImpl>
59 make(
const bsl::shared_ptr<rmqamqp::Connection>& amqpConn,
60 rmqio::EventLoop& eventLoop,
61 bdlmt::ThreadPool& threadpool,
62 const rmqt::ErrorCallback& errorCb,
63 const bsl::shared_ptr<rmqt::Endpoint>& endpoint,
64 const rmqt::Tunables& tunables,
65 const bsl::shared_ptr<rmqa::ConsumerImpl::Factory>& consumerFactory,
66 const bsl::shared_ptr<rmqa::ProducerImpl::Factory>& producerFactory);
68 void close() BSLS_KEYWORD_OVERRIDE;
72 rmqt::ExchangeHandle exchange,
73 uint16_t maxOutstandingConfirms) BSLS_KEYWORD_OVERRIDE;
77 rmqt::QueueHandle queue,
83 rmqt::ExchangeHandle exchange,
84 uint16_t maxOutstandingConfirms) BSLS_KEYWORD_OVERRIDE;
88 rmqt::QueueHandle queue,
96 const bsl::shared_ptr<rmqamqp::Connection>& amqpConn,
97 rmqio::EventLoop& loop,
98 bdlmt::ThreadPool& threadPool,
99 const rmqt::ErrorCallback& errorCb,
100 const bsl::shared_ptr<rmqt::Endpoint>& endpoint,
101 const rmqt::Tunables& tunables,
102 const bsl::shared_ptr<rmqa::ConsumerImpl::Factory>& consumerFactory,
103 const bsl::shared_ptr<rmqa::ProducerImpl::Factory>& producerFactory);
105 void ready(
bool success =
true);
110 rmqt::Tunables d_tunables;
111 bsl::shared_ptr<rmqamqp::Connection> d_connection;
112 bdlmt::ThreadPool& d_threadPool;
113 rmqio::EventLoop& d_eventLoop;
114 rmqt::ErrorCallback d_onError;
115 bsl::shared_ptr<rmqt::Endpoint> d_endpoint;
117 bsl::shared_ptr<rmqa::ConsumerImpl::Factory> d_consumerFactory;
118 bsl::shared_ptr<rmqa::ProducerImpl::Factory> d_producerFactory;
Definition: rmqa_connectionimpl.h:56
void close() BSLS_KEYWORD_OVERRIDE
Flush all data pending and then close the connection. Close the connection and invalidates all consum...
Definition: rmqa_connectionimpl.cpp:178
rmqt::Result< rmqp::Producer > createProducer(const rmqt::Topology &topology, rmqt::ExchangeHandle exchange, uint16_t maxOutstandingConfirms) BSLS_KEYWORD_OVERRIDE
Definition: rmqa_connectionimpl.cpp:233
rmqt::Result< rmqp::Consumer > createConsumer(const rmqt::Topology &topology, rmqt::QueueHandle queue, const rmqp::Consumer::ConsumerFunc &onMessage, const rmqt::ConsumerConfig &consumerConfig) BSLS_KEYWORD_OVERRIDE
Create an asynchronous consumer using the provided Topology.
Definition: rmqa_connectionimpl.cpp:242
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