-
Notifications
You must be signed in to change notification settings - Fork 1
/
test.conf
304 lines (277 loc) · 5.96 KB
/
test.conf
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
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
# NanoMQ Configuration 0.12.2
##============================================================
## NanoMQ Broker
##============================================================
url="nmq-tcp://0.0.0.0:1883"
daemon=false
num_taskq_thread=0
max_taskq_thread=0
parallel=0
property_size=32
max_packet_size=1024
client_max_packet_size=1024
msq_len=2048
qos_duration=10
keepalive_backoff=1250
allow_anonymous=true
tls {
enable=false
url="tls+nmq-tcp://0.0.0.0:8883"
keyfile="/etc/certs/key.pem"
certfile="/etc/certs/cert.pem"
cacertfile="/etc/certs/cacert.pem"
verify_peer=false
fail_if_no_peer_cert=false
}
websocket {
enable=true
url="nmq-ws://0.0.0.0:8083/mqtt"
tls_url="nmq-wss://0.0.0.0:8084/mqtt"
}
http_server {
enable=true
port=8081
parallel=32
username=admin
password=public
auth_type=basic
jwt {
public.keyfile="/etc/certs/jwt/jwtRS256.key.pub"
private.keyfile="/etc/certs/jwt/jwtRS256.key"
}
}
log {
to=[file,console]
level=info
dir="/tmp"
file="nanomq.log"
rotation {
size=10MB
count=5
}
}
sqlite {
enable=false,
disk_cache_size=102400,
# mounted_file_path="/tmp/"
flush_mem_threshold=100
resend_interval=5000
}
webhook {
enable=false
url="http://127.0.0.1:80"
headers.content-type="application/json"
body.encoding=plain
pool_size=32
}
webhook.rule.client.connect=[{action: on_client_connect}]
webhook.rule.client.connack=[{action: on_client_connack}]
webhook.rule.client.connected=[{action: on_client_connected}]
webhook.rule.client.disconnected=[{action: on_client_disconnected}]
webhook.rule.client.subscribe=[{action: on_client_subscribe}]
webhook.rule.client.unsubscribe=[{action: on_client_unsubscribe}]
webhook.rule.session.subscribed=[{action: on_session_subscribed}]
webhook.rule.session.unsubscribed=[{action: on_session_unsubscribed}]
webhook.rule.session.terminated=[{action: on_session_terminated}]
webhook.rule.message.publish=[{action: on_message_publish}]
webhook.rule.message.delivered=[{action: on_message_delivered}]
webhook.rule.message.acked=[{action: on_message_acked}]
auth_http {
enable = false
auth_req {
url = "http://127.0.0.1:80/mqtt/auth"
method = post
headers.content-type = "application/x-www-form-urlencoded"
params = {clientid = "%c",username = "%u", password = "%p"}
}
super_req {
url = "http://127.0.0.1:80/mqtt/superuser"
method = post
headers.content-type = "application/x-www-form-urlencoded"
params = {clientid = "%c",username = "%u", password= "%p"}
}
acl_req {
url = "http://127.0.0.1:8991/mqtt/acl"
method = post
headers.content-type = "application/x-www-form-urlencoded"
params = {clientid = "%c", username = "%u", access = "%A",ipaddr="%a",topic="%t",mountpoint="%m"}
}
timeout = 5s
connect_timeout = 5s
pool_size = 32
}
bridge.mqtt {
nodes [
{
name=emqx
address="mqtt-tcp://localhost:1883"
proto_ver=4
enable=true
clientid="bridge_client"
keepalive=60
clean_start=false
username=username
password=passwd
forwards=["topic1/#","topic2/#"]
quic_keepalive=120
quic_idle_timeout=120
quic_discon_timeout=20
quic_handshake_timeout=60
hybrid_bridging=false
congestion_control=cubic
subscription
[
{
topic="cmd/topic1"
qos=1
}
{
topic="cmd/topic2"
qos=2
}
]
parallel=2,
tls {
enable=false
key_password=yourpass
keyfile="/etc/certs/key.pem"
certfile="/etc/certs/cert.pem"
cacertfile="/etc/certs/cacert.pem"
}
}
]
sqlite {
enable=false
disk_cache_size=102400
flush_mem_threshold=100
resend_interval=5000
mounted_file_path="/tmp/"
}
}
bridge.aws.nodes [
{
name=aws
hosts="127.0.0.1"
port=8883
proto_ver=4
enable=false
clientid="aws_bridge_client"
keepalive=60
clean_start=false
username=username
password=passwd
forwards=["topic1/#","topic2/#"]
subscription
[
{
topic="cmd/topic1"
qos=1
}
{
topic="cmd/topic2"
qos=2
}
]
parallel=2,
tls {
enable=false
key_password=yourpass
keyfile="/etc/certs/key.pem"
certfile="/etc/certs/cert.pem"
cacertfile="/etc/certs/cacert.pem"
}
}
]
rules.option=OFF
rules.sqlite {
path="/tmp/sqlite_rule.db"
enabled=false
rules=[
{
enabled=true
sql="SELECT payload.x.y as y, payload.z as z FROM \"#\" WHERE y > 10 and z != 'str'"
table=broker
}
{
enabled=true
sql="SELECT topic, payload FROM \"abc\""
table=broker1
}
{
enabled=true
sql="SELECT * FROM \"#\" "
table=broker2
}
]
}
rules.repub {
enabled=false
rules=[
{
enabled=true
address="mqtt-tcp://localhost:1883"
topic="topic/repub1"
proto_ver=4
clientid="repub_client1"
keepalive=60
clean_start=true
username=username
password=passwd
sql="SELECT payload.x.y as y, payload.z as z FROM \"#\" WHERE y > 10 and z != 'str'"
}
{
enabled=true
address="mqtt-tcp://localhost:1885"
topic="topic/repub2"
proto_ver=4
clientid="repub_client2"
keepalive=60
clean_start=true
username=username
password=passwd
sql="SELECT topic, payload FROM \"abc\""
}
{
enabled=true
address="mqtt-tcp://broker.emqx.io:1883"
topic="topic/repub3"
proto_ver=4
clientid="repub_client3"
keepalive=60
clean_start=true
username=username
password=passwd
sql="SELECT * FROM \"#\" "
}
]
}
rules.mysql {
name="mysql_rule_db"
enabled=false
rules=[
{
enabled=true
table=broker
host=localhost
username=username
password=password
sql="SELECT payload.x.y as y, payload.z as z FROM \"#\" WHERE y > 10 and z != 'str'"
}
{
enabled=true
table=broker1
host=localhost
username=username
password=password
event.publish.sql="SELECT * FROM \"abc\""
}
{
enabled=true
table=broker2
host=localhost
username=username
password=password
event.publish.sql="SELECT payload, qos FROM \"#\" WHERE qos > 0"
}
]
}