userver
C++ Async Framework
Loading...
Searching...
No Matches
component.hpp
Go to the documentation of this file.
1
#
pragma
once
2
3
/// @file userver/urabbitmq/component.hpp
4
/// @brief @copybrief components::RabbitMQ
5
6
#
include
<
memory
>
7
8
#
include
<
userver
/
components
/
component_base
.
hpp
>
9
10
USERVER_NAMESPACE_BEGIN
11
12
namespace
clients::
dns
{
13
class
Component;
14
}
15
16
namespace
urabbitmq {
17
class
Client
;
18
}
19
20
namespace
components
{
21
22
/// @ingroup userver_components
23
///
24
/// @brief RabbitMQ (AMQP 0.9.1) client component
25
///
26
/// Provides access to a RabbitMQ cluster.
27
///
28
/// ## Static configuration example:
29
///
30
/// @snippet samples/rabbitmq_service/static_config.yaml RabbitMQ service sample - static config
31
///
32
/// If the component is configured with an secdist_alias, it will lookup
33
/// connection data in secdist.json via secdist_alias value, otherwise via
34
/// components name.
35
///
36
/// ## Secdist format
37
///
38
/// A RabbitMQ alias in secdist is described as a JSON object
39
/// 'rabbitmq_settings', containing descriptions of RabbitMQ clusters.
40
///
41
/// @snippet samples/rabbitmq_service/tests/conftest.py RabbitMQ service sample - secdist
42
///
43
/// ## Static options of components::RabbitMQ :
44
/// @include{doc} scripts/docs/en/components_schema/rabbitmq/src/urabbitmq/component.md
45
///
46
/// Options inherited from @ref components::ComponentBase :
47
/// @include{doc} scripts/docs/en/components_schema/core/src/components/impl/component_base.md
48
class
RabbitMQ
final
:
public
ComponentBase
{
49
public
:
50
/// Component constructor
51
RabbitMQ
(
const
ComponentConfig& config,
const
ComponentContext& context);
52
/// Component destructor
53
~
RabbitMQ
()
override
;
54
55
/// Cluster accessor
56
std::shared_ptr<urabbitmq::
Client
>
GetClient
()
const
;
57
58
static
yaml_config::Schema GetStaticConfigSchema();
59
60
private
:
61
clients::
dns
::Component& dns_;
62
std::shared_ptr<urabbitmq::
Client
> client_;
63
};
64
65
template
<>
66
inline
constexpr
bool
kHasValidate<RabbitMQ> =
true
;
67
68
}
// namespace components
69
70
USERVER_NAMESPACE_END
userver
urabbitmq
component.hpp
Generated on Thu May 21 2026 16:20:03 for userver by
Doxygen
1.13.2