fix(bridges): do not start any bridge by default
This commit is contained in:
parent
1ecec5ef3a
commit
135c005467
|
@ -2,169 +2,48 @@
|
||||||
## EMQ X Bridge
|
## EMQ X Bridge
|
||||||
##--------------------------------------------------------------------
|
##--------------------------------------------------------------------
|
||||||
|
|
||||||
bridges.mqtt.my_mqtt_bridge {
|
#bridges.mqtt.my_mqtt_bridge {
|
||||||
server = "127.0.0.1:1883"
|
# server = "127.0.0.1:1883"
|
||||||
proto_ver = "v4"
|
# proto_ver = "v4"
|
||||||
## the clientid will be the concatenation of `clientid_prefix` and ids in `in` and `out`.
|
# ## the clientid will be the concatenation of `clientid_prefix` and ids in `in` and `out`.
|
||||||
clientid_prefix = "bridge_client:"
|
# clientid_prefix = "bridge_client:"
|
||||||
username = "username1"
|
# username = "username1"
|
||||||
password = ""
|
# password = ""
|
||||||
clean_start = true
|
# clean_start = true
|
||||||
keepalive = 300
|
# keepalive = 300
|
||||||
retry_interval = "30s"
|
# retry_interval = "30s"
|
||||||
max_inflight = 32
|
# max_inflight = 32
|
||||||
reconnect_interval = "30s"
|
# reconnect_interval = "30s"
|
||||||
bridge_mode = true
|
# bridge_mode = true
|
||||||
replayq {
|
# replayq {
|
||||||
dir = "{{ platform_data_dir }}/replayq/bridge_mqtt/"
|
# dir = "{{ platform_data_dir }}/replayq/bridge_mqtt/"
|
||||||
seg_bytes = "100MB"
|
# seg_bytes = "100MB"
|
||||||
offload = false
|
# offload = false
|
||||||
max_total_bytes = "1GB"
|
# max_total_bytes = "1GB"
|
||||||
}
|
|
||||||
ssl {
|
|
||||||
enable = false
|
|
||||||
keyfile = "{{ platform_etc_dir }}/certs/client-key.pem"
|
|
||||||
certfile = "{{ platform_etc_dir }}/certs/client-cert.pem"
|
|
||||||
cacertfile = "{{ platform_etc_dir }}/certs/cacert.pem"
|
|
||||||
}
|
|
||||||
## we will create one MQTT connection for each element of the `in`
|
|
||||||
in: [{
|
|
||||||
id = "pull_msgs_from_aws"
|
|
||||||
subscribe_remote_topic = "aws/#"
|
|
||||||
subscribe_qos = 1
|
|
||||||
local_topic = "from_aws/${topic}"
|
|
||||||
payload = "${payload}"
|
|
||||||
qos = "${qos}"
|
|
||||||
retain = "${retain}"
|
|
||||||
}]
|
|
||||||
## we will create one MQTT connection for each element of the `out`
|
|
||||||
out: [{
|
|
||||||
id = "push_msgs_to_aws"
|
|
||||||
subscribe_local_topic = "emqx/#"
|
|
||||||
remote_topic = "from_emqx/${topic}"
|
|
||||||
payload = "${payload}"
|
|
||||||
qos = 1
|
|
||||||
retain = false
|
|
||||||
}]
|
|
||||||
}
|
|
||||||
|
|
||||||
# {name: "mysql_bridge_1"
|
|
||||||
# type: mysql
|
|
||||||
# config: {
|
|
||||||
# server: "192.168.0.172:3306"
|
|
||||||
# database: mqtt
|
|
||||||
# pool_size: 1
|
|
||||||
# username: root
|
|
||||||
# password: public
|
|
||||||
# auto_reconnect: true
|
|
||||||
# ssl: false
|
|
||||||
# }
|
|
||||||
# }
|
# }
|
||||||
# , {name: "pgsql_bridge_1"
|
# ssl {
|
||||||
# type: pgsql
|
# enable = false
|
||||||
# config: {
|
# keyfile = "{{ platform_etc_dir }}/certs/client-key.pem"
|
||||||
# server: "192.168.0.172:5432"
|
# certfile = "{{ platform_etc_dir }}/certs/client-cert.pem"
|
||||||
# database: mqtt
|
# cacertfile = "{{ platform_etc_dir }}/certs/cacert.pem"
|
||||||
# pool_size: 1
|
|
||||||
# username: root
|
|
||||||
# password: public
|
|
||||||
# auto_reconnect: true
|
|
||||||
# ssl: false
|
|
||||||
# }
|
|
||||||
# }
|
# }
|
||||||
# , {name: "mongodb_bridge_single"
|
# ## we will create one MQTT connection for each element of the `in`
|
||||||
# type: mongo
|
# in: [{
|
||||||
# config: {
|
# id = "pull_msgs_from_aws"
|
||||||
# servers: "192.168.0.172:27017"
|
# subscribe_remote_topic = "aws/#"
|
||||||
# mongo_type: single
|
# subscribe_qos = 1
|
||||||
# pool_size: 1
|
# local_topic = "from_aws/${topic}"
|
||||||
# login: root
|
# payload = "${payload}"
|
||||||
# password: public
|
# qos = "${qos}"
|
||||||
# auth_source: mqtt
|
# retain = "${retain}"
|
||||||
# database: mqtt
|
# }]
|
||||||
# ssl: false
|
# ## we will create one MQTT connection for each element of the `out`
|
||||||
# }
|
# out: [{
|
||||||
# }
|
# id = "push_msgs_to_aws"
|
||||||
# ,{name: "mongodb_bridge_rs"
|
# subscribe_local_topic = "emqx/#"
|
||||||
# type: mongo
|
# remote_topic = "from_emqx/${topic}"
|
||||||
# config: {
|
# payload = "${payload}"
|
||||||
# servers: "127.0.0.1:27017"
|
# qos = 1
|
||||||
# mongo_type: rs
|
# retain = false
|
||||||
# rs_set_name: rs_name
|
# }]
|
||||||
# pool_size: 1
|
#}
|
||||||
# login: root
|
|
||||||
# password: public
|
|
||||||
# auth_source: mqtt
|
|
||||||
# database: mqtt
|
|
||||||
# ssl: false
|
|
||||||
# }
|
|
||||||
# }
|
|
||||||
# ,{name: "mongodb_bridge_shared"
|
|
||||||
# type: mongo
|
|
||||||
# config: {
|
|
||||||
# servers: "127.0.0.1:27017"
|
|
||||||
# mongo_type: shared
|
|
||||||
# pool_size: 1
|
|
||||||
# login: root
|
|
||||||
# password: public
|
|
||||||
# auth_source: mqtt
|
|
||||||
# database: mqtt
|
|
||||||
# ssl: false
|
|
||||||
# max_overflow: 1
|
|
||||||
# overflow_ttl:
|
|
||||||
# overflow_check_period: 10s
|
|
||||||
# local_threshold_ms: 10s
|
|
||||||
# connect_timeout_ms: 10s
|
|
||||||
# socket_timeout_ms: 10s
|
|
||||||
# server_selection_timeout_ms: 10s
|
|
||||||
# wait_queue_timeout_ms: 10s
|
|
||||||
# heartbeat_frequency_ms: 10s
|
|
||||||
# min_heartbeat_frequency_ms: 10s
|
|
||||||
# }
|
|
||||||
# }
|
|
||||||
# , {name: "redis_bridge_single"
|
|
||||||
# type: redis
|
|
||||||
# config: {
|
|
||||||
# servers: "192.168.0.172:6379"
|
|
||||||
# redis_type: single
|
|
||||||
# pool_size: 1
|
|
||||||
# database: 0
|
|
||||||
# password: public
|
|
||||||
# auto_reconnect: true
|
|
||||||
# ssl: false
|
|
||||||
# }
|
|
||||||
# }
|
|
||||||
# ,{name: "redis_bridge_sentinel"
|
|
||||||
# type: redis
|
|
||||||
# config: {
|
|
||||||
# servers: "127.0.0.1:6379, 127.0.0.2:6379, 127.0.0.3:6379"
|
|
||||||
# redis_type: sentinel
|
|
||||||
# sentinel_name: mymaster
|
|
||||||
# pool_size: 1
|
|
||||||
# database: 0
|
|
||||||
# ssl: false
|
|
||||||
# }
|
|
||||||
# }
|
|
||||||
# ,{name: "redis_bridge_cluster"
|
|
||||||
# type: redis
|
|
||||||
# config: {
|
|
||||||
# servers: "127.0.0.1:6379, 127.0.0.2:6379, 127.0.0.3:6379"
|
|
||||||
# redis_type: cluster
|
|
||||||
# pool_size: 1
|
|
||||||
# database: 0
|
|
||||||
# password: "public"
|
|
||||||
# ssl: false
|
|
||||||
# }
|
|
||||||
# }
|
|
||||||
# , {name: "ldap_bridge_1"
|
|
||||||
# type: ldap
|
|
||||||
# config: {
|
|
||||||
# servers: "192.168.0.172"
|
|
||||||
# port: 389
|
|
||||||
# bind_dn: "cn=root,dc=emqx,dc=io"
|
|
||||||
# bind_password: "public"
|
|
||||||
# timeout: 30s
|
|
||||||
# pool_size: 1
|
|
||||||
# ssl: false
|
|
||||||
# }
|
|
||||||
# }
|
|
||||||
|
|
|
@ -55,7 +55,7 @@ make_pub_vars(Mountpoint, #{payload := _, qos := _, retain := _, local_topic :=
|
||||||
%% Shame that we have to know the callback module here
|
%% Shame that we have to know the callback module here
|
||||||
%% would be great if we can get rid of #mqtt_msg{} record
|
%% would be great if we can get rid of #mqtt_msg{} record
|
||||||
%% and use #message{} in all places.
|
%% and use #message{} in all places.
|
||||||
-spec to_remote_msg(msg(), variables())
|
-spec to_remote_msg(msg() | map(), variables())
|
||||||
-> exp_msg().
|
-> exp_msg().
|
||||||
to_remote_msg(#message{flags = Flags0} = Msg, Vars) ->
|
to_remote_msg(#message{flags = Flags0} = Msg, Vars) ->
|
||||||
Retain0 = maps:get(retain, Flags0, false),
|
Retain0 = maps:get(retain, Flags0, false),
|
||||||
|
|
|
@ -222,7 +222,6 @@ do_compare('<=', L, R) -> L =< R;
|
||||||
do_compare('>=', L, R) -> L >= R;
|
do_compare('>=', L, R) -> L >= R;
|
||||||
do_compare('<>', L, R) -> L /= R;
|
do_compare('<>', L, R) -> L /= R;
|
||||||
do_compare('!=', L, R) -> L /= R;
|
do_compare('!=', L, R) -> L /= R;
|
||||||
do_compare('~=', T, F) -> emqx_topic:match(T, F);
|
|
||||||
do_compare('=~', T, F) -> emqx_topic:match(T, F).
|
do_compare('=~', T, F) -> emqx_topic:match(T, F).
|
||||||
|
|
||||||
number(Bin) ->
|
number(Bin) ->
|
||||||
|
|
Loading…
Reference in New Issue