RMQ - RabbitMQ C++ Library
rmqp_topology.h
1// Copyright 2020-2023 Bloomberg Finance L.P.
2// SPDX-License-Identifier: Apache-2.0
3//
4// Licensed under the Apache License, Version 2.0 (the "License");
5// you may not use this file except in compliance with the License.
6// You may obtain a copy of the License at
7//
8// http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
15
16#ifndef INCLUDED_RMQP_TOPOLOGY
17#define INCLUDED_RMQP_TOPOLOGY
18
19#include <rmqt_exchange.h>
20#include <rmqt_exchangetype.h>
21#include <rmqt_fieldvalue.h>
22#include <rmqt_properties.h>
23#include <rmqt_queue.h>
24#include <rmqt_topology.h>
25
26#include <bsl_ostream.h>
27#include <bsl_string.h>
28
29namespace BloombergLP {
30namespace rmqp {
31
38
39class Topology {
40 public:
41 // CREATORS
42 virtual ~Topology();
43
61 virtual rmqt::QueueHandle
62 addQueue(const bsl::string& name = bsl::string(),
63 rmqt::AutoDelete::Value = rmqt::AutoDelete::OFF,
64 rmqt::Durable::Value = rmqt::Durable::ON,
65 const rmqt::FieldTable& args = rmqt::FieldTable()) = 0;
66
88 virtual rmqt::ExchangeHandle addExchange(
89 const bsl::string& name,
90 const rmqt::ExchangeType& exchangeType = rmqt::ExchangeType::DIRECT,
91 rmqt::AutoDelete::Value autoDelete = rmqt::AutoDelete::OFF,
92 rmqt::Durable::Value durable = rmqt::Durable::ON,
93 rmqt::Internal::Value internal = rmqt::Internal::NO,
94 const rmqt::FieldTable& args = rmqt::FieldTable()) = 0;
95
103 virtual rmqt::ExchangeHandle
104 addPassiveExchange(const bsl::string& name) = 0;
105
113 virtual rmqt::QueueHandle addPassiveQueue(const bsl::string& name) = 0;
114
116 virtual void bind(const rmqt::ExchangeHandle& exchangeName,
117 const rmqt::QueueHandle& queue,
118 const bsl::string& bindingKey,
119 const rmqt::FieldTable& args = rmqt::FieldTable()) = 0;
120
122 virtual void bind(const rmqt::ExchangeHandle& exchange1,
123 const rmqt::ExchangeHandle& exchange2,
124 const bsl::string& bindingKey,
125 const rmqt::FieldTable& args = rmqt::FieldTable()) = 0;
126
130 virtual const rmqt::Topology& topology() const = 0;
131
136 virtual const rmqt::ExchangeHandle defaultExchange() = 0;
137
138}; // class Topology
139
140} // namespace rmqp
141} // namespace BloombergLP
142
143#endif // ! INCLUDED_RMQP_TOPOLOGY
An interface providing a manipulatable RabbitMQ topology structure.
Definition: rmqp_topology.h:39
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.
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.
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.
virtual const rmqt::Topology & topology() const =0
Get a readonly copy of stored topology.
virtual rmqt::ExchangeHandle addPassiveExchange(const bsl::string &name)=0
Declare a dependency on Exchange (without creating it)
virtual const rmqt::ExchangeHandle defaultExchange()=0
Retrieve a handle for the default exchange.
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.
virtual rmqt::QueueHandle addPassiveQueue(const bsl::string &name)=0
Declare a dependency on Queue (without creating it)
AMQP Exchange types.
Definition: rmqt_exchangetype.h:27
Definition: rmqt_topology.h:32
Represents AMQP 0.9.1 Field Table (dict of FieldValues)
Definition: rmqt_fieldvalue.h:108