/
rabbit_mqtt.hrl
88 lines (82 loc) · 2.24 KB
/
rabbit_mqtt.hrl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
%% This Source Code Form is subject to the terms of the Mozilla Public
%% License, v. 2.0. If a copy of the MPL was not distributed with this
%% file, You can obtain one at https://mozilla.org/MPL/2.0/.
%%
%% Copyright (c) 2007-2024 Broadcom. All Rights Reserved. The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. All rights reserved.
%%
-define(APP_NAME, rabbitmq_mqtt).
-define(PG_SCOPE, pg_scope_rabbitmq_mqtt_clientid).
-define(QUEUE_TYPE_QOS_0, rabbit_mqtt_qos0_queue).
-define(PERSISTENT_TERM_MAILBOX_SOFT_LIMIT, mqtt_mailbox_soft_limit).
-define(PERSISTENT_TERM_EXCHANGE, mqtt_exchange).
-define(DEFAULT_MQTT_EXCHANGE, <<"amq.topic">>).
-define(MQTT_GUIDE_URL, <<"https://rabbitmq.com/docs/mqtt/">>).
-define(MQTT_TCP_PROTOCOL, 'mqtt').
-define(MQTT_TLS_PROTOCOL, 'mqtt/ssl').
-define(MQTT_PROTO_V3, mqtt310).
-define(MQTT_PROTO_V4, mqtt311).
-define(MQTT_PROTO_V5, mqtt50).
-type protocol_version_atom() :: ?MQTT_PROTO_V3 | ?MQTT_PROTO_V4 | ?MQTT_PROTO_V5.
-define(ITEMS,
[pid,
protocol,
host,
port,
peer_host,
peer_port,
ssl,
ssl_protocol,
ssl_key_exchange,
ssl_cipher,
ssl_hash,
vhost,
user
]).
-define(INFO_ITEMS,
?ITEMS ++
[
client_id,
conn_name,
user_property,
connection_state,
ssl_login_name,
recv_cnt,
recv_oct,
send_cnt,
send_oct,
send_pend,
clean_sess,
will_msg,
retainer_pid,
exchange,
prefetch,
messages_unconfirmed,
messages_unacknowledged
]).
%% Connection opened or closed.
-define(EVENT_KEYS,
?ITEMS ++
[name,
client_properties,
peer_cert_issuer,
peer_cert_subject,
peer_cert_validity,
auth_mechanism,
timeout,
frame_max,
channel_max,
connected_at,
node,
user_who_performed_action
]).
-define(SIMPLE_METRICS,
[pid,
recv_oct,
send_oct,
reductions]).
-define(OTHER_METRICS,
[recv_cnt,
send_cnt,
send_pend,
garbage_collection,
state]).