diff --git a/rel/files/emqttd.config.development b/rel/files/emqttd.config.development index 50339361c..76375d227 100644 --- a/rel/files/emqttd.config.development +++ b/rel/files/emqttd.config.development @@ -1,6 +1,6 @@ % -*- mode: erlang;erlang-indent-level: 4;indent-tabs-mode: nil -*- %% ex: ft=erlang ts=4 sw=4 et -[{kernel, +[{kernel, [{start_timer, true}, {start_pg2, true} ]}, @@ -175,14 +175,22 @@ {modules, [ %% Client presence management module. %% Publish messages when client connected or disconnected - {presence, [{qos, 0}]} + {presence, [{qos, 0}]}, %% Subscribe topics automatically when client connected - %% {autosub, [{"$Q/client/$c", 0}]} + {subscription, [ + %% Subscription from stored table + stored, + + %% $u will be replaced with username + {"$Q/username/$u", 1}, + + %% $c will be replaced with clientid + {"$Q/client/$c", 1} + ]} %% Rewrite rules %% {rewrite, [{file, "etc/rewrite.config"}]} - ]}, %% Plugins {plugins, [ diff --git a/rel/files/emqttd.config.production b/rel/files/emqttd.config.production index e602e60ba..ef18232b8 100644 --- a/rel/files/emqttd.config.production +++ b/rel/files/emqttd.config.production @@ -167,14 +167,22 @@ {modules, [ %% Client presence management module. %% Publish messages when client connected or disconnected - {presence, [{qos, 0}]} + %% {presence, [{qos, 0}]}, %% Subscribe topics automatically when client connected - %% {autosub, [{"$Q/client/$c", 0}]} + %% {subscription, [ + %% %% Subscription from stored table + %% stored, + %% + %% %% $u will be replaced with username + %% {"$Q/username/$u", 1}, + %% + %% %% $c will be replaced with clientid + %% {"$Q/client/$c", 1} + %% ]} %% Rewrite rules %% {rewrite, [{file, "etc/rewrite.config"}]} - ]}, %% Plugins {plugins, [