-
Notifications
You must be signed in to change notification settings - Fork 220
/
default_config.yml
169 lines (155 loc) · 7.57 KB
/
default_config.yml
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
# Path to pid file.
# If not set, there will be no pid file.
# pid_file: /var/run/gmqttd.pid
listeners:
# bind address
- address: ":1883"
# tls:
# cacert: "path_to_ca_cert_file"
# cert: "path_to_cert_file"
# key: "path_to_key_file"
- address: ":8883"
# websocket setting
websocket:
path: "/"
api:
grpc:
# The gRPC server listen address. Supports unix socket and tcp socket.
- address: "tcp://127.0.0.1:8084"
#- address: "unix:///var/run/gmqttd.sock"
# tls:
# cacert: "path_to_ca_cert_file"
# cert: "path_to_cert_file"
# key: "path_to_key_file"
http:
# The HTTP server listen address. This is a reverse-proxy server in front of gRPC server.
- address: "tcp://127.0.0.1:8083"
map: "tcp://127.0.0.1:8084" # The backend gRPC server endpoint,
# tls:
# cacert: "path_to_ca_cert_file"
# cert: "path_to_cert_file"
# key: "path_to_key_file"
mqtt:
# The maximum session expiry interval in seconds.
session_expiry: 2h
# The interval time for session expiry checker to check whether there are expired sessions.
session_expiry_check_timer: 20s
# The maximum lifetime of the message in seconds.
# If a message in the queue is not sent in message_expiry time, it will be dropped, which means it will not be sent to the subscriber.
message_expiry: 2h
# The lifetime of the "inflight" message in seconds.
# If a "inflight" message is not acknowledged by a client in inflight_expiry time, it will be removed when the message queue is full.
inflight_expiry: 30s
# The maximum packet size that the server is willing to accept from the client.
max_packet_size: 268435456
# The maximum number of QoS 1 and QoS 2 publications that the server is willing to process concurrently for the client.
server_receive_maximum: 100
# The maximum keep alive time in seconds allows by the server.
# If the client requests a keepalive time bigger than MaxKeepalive,the server will use MaxKeepAlive as the keepalive time.
# In this case, if the client version is v5, the server will set MaxKeepalive into CONNACK to inform the client.
# But if the client version is 3.x, the server has no way to inform the client that the keepalive time has been changed.
max_keepalive: 300
# The highest value that the server will accept as a Topic Alias sent by the client.
# No-op if the client version is MQTTv3.x .
topic_alias_maximum: 10
# Whether the server supports Subscription Identifiers.
# No-op if the client version is MQTTv3.x .
subscription_identifier_available: true
# Whether the server supports Wildcard Subscriptions.
wildcard_subscription_available: true
# Whether the server supports Shared Subscriptions.
shared_subscription_available: true
# The highest QOS level permitted for a Publish.
maximum_qos: 2
# Whether the server supports retained messages.
retain_available: true
# The maximum queue length of the outgoing messages.
# If the queue is full, some message will be dropped.
# The message dropping strategy is described in the document of the persistence/queue.Store interface.
max_queued_messages: 1000
# The limits of inflight message length of the outgoing messages.
# Inflight message is also stored in the message queue, so it must be less than or equal to max_queued_messages.
# Inflight message is the QoS 1 or QoS 2 message that has been sent out to a client but not been acknowledged yet.
max_inflight: 100
# Whether to store QoS 0 message for a offline session.
queue_qos0_messages: true
# The delivery mode. The possible value can be "overlap" or "onlyonce".
# It is possible for a client’s subscriptions to overlap so that a published message might match multiple filters.
# When set to "overlap" , the server will deliver one message for each matching subscription and respecting the subscription’s QoS in each case.
# When set to "onlyonce", the server will deliver the message to the client respecting the maximum QoS of all the matching subscriptions.
delivery_mode: onlyonce
# Whether to allow a client to connect with empty client id.
allow_zero_length_clientid: true
persistence:
type: memory # memory | redis
# The redis configuration only take effect when type == redis.
redis:
# redis server address
addr: "127.0.0.1:6379"
# the maximum number of idle connections in the redis connection pool.
max_idle: 1000
# the maximum number of connections allocated by the redis connection pool at a given time.
# If zero, there is no limit on the number of connections in the pool.
max_active: 0
# the connection idle timeout, connection will be closed after remaining idle for this duration. If the value is zero, then idle connections are not closed.
idle_timeout: 240s
password: ""
# the number of the redis database.
database: 0
# The topic alias manager setting. The topic alias feature is introduced by MQTT V5.
# This setting is used to control how the broker manage topic alias.
topic_alias_manager:
# Currently, only FIFO strategy is supported.
type: fifo
plugins:
prometheus:
path: "/metrics"
listen_address: ":8082"
auth:
# Password hash type. (plain | md5 | sha256 | bcrypt)
# Default to MD5.
hash: md5
# The file to store password. If it is a relative path, it locates in the same directory as the config file.
# (e.g: ./gmqtt_password => /etc/gmqtt/gmqtt_password.yml)
# Defaults to ./gmqtt_password.yml
# password_file:
federation:
# node_name is the unique identifier for the node in the federation. Defaults to hostname.
# node_name:
# fed_addr is the gRPC server listening address for the federation internal communication. Defaults to :8901
fed_addr: :8901
# advertise_fed_addr is used to change the federation gRPC server address that we advertise to other nodes in the cluster.
# Defaults to "fed_addr".However, in some cases, there may be a routable address that cannot be bound.
# If the port is missing, the default federation port (8901) will be used.
advertise_fed_addr: :8901
# gossip_addr is the address that the gossip will listen on, It is used for both UDP and TCP gossip. Defaults to :8902
gossip_addr: :8902
# advertise_gossip_addr is used to change the gossip server address that we advertise to other nodes in the cluster.
# Defaults to "GossipAddr" or the private IP address of the node if the IP in "GossipAddr" is 0.0.0.0.
# If the port is missing, the default gossip port (8902) will be used.
advertise_gossip_addr: :8902
# retry_join is the address of other nodes to join upon starting up.
# If port is missing, the default gossip port (8902) will be used.
#retry_join:
# - 127.0.0.1:8902
# rejoin_after_leave will be pass to "RejoinAfterLeave" in serf configuration.
# It controls our interaction with the snapshot file.
# When set to false (default), a leave causes a Serf to not rejoin the cluster until an explicit join is received.
# If this is set to true, we ignore the leave, and rejoin the cluster on start.
rejoin_after_leave: false
# snapshot_path will be pass to "SnapshotPath" in serf configuration.
# When Serf is started with a snapshot,it will attempt to join all the previously known nodes until one
# succeeds and will also avoid replaying old user events.
snapshot_path:
# plugin loading orders
plugin_order:
# Uncomment auth to enable authentication.
# - auth
- prometheus
- admin
- federation
log:
level: info # debug | info | warn | error
format: text # json | text
# whether to dump MQTT packet in debug level
dump_packet: false