don't create topics
This commit is contained in:
parent
d6c9ee66a3
commit
8b6cc4d5f8
|
@ -115,9 +115,6 @@ stop_tick(TRef) ->
|
||||||
init([]) ->
|
init([]) ->
|
||||||
emqttd_time:seed(),
|
emqttd_time:seed(),
|
||||||
ets:new(?BROKER_TAB, [set, public, named_table]),
|
ets:new(?BROKER_TAB, [set, public, named_table]),
|
||||||
% Create $SYS Topics
|
|
||||||
emqttd:create(topic, <<"$SYS/brokers">>),
|
|
||||||
[ok = create_topic(Topic) || Topic <- ?SYSTOP_BROKERS],
|
|
||||||
% Tick
|
% Tick
|
||||||
{ok, #state{started_at = os:timestamp(),
|
{ok, #state{started_at = os:timestamp(),
|
||||||
heartbeat = start_tick(1000, heartbeat),
|
heartbeat = start_tick(1000, heartbeat),
|
||||||
|
@ -160,9 +157,6 @@ code_change(_OldVsn, State, _Extra) ->
|
||||||
%% Internal functions
|
%% Internal functions
|
||||||
%%--------------------------------------------------------------------
|
%%--------------------------------------------------------------------
|
||||||
|
|
||||||
create_topic(Topic) ->
|
|
||||||
emqttd:create(topic, emqttd_topic:systop(Topic)).
|
|
||||||
|
|
||||||
retain(brokers) ->
|
retain(brokers) ->
|
||||||
Payload = list_to_binary(string:join([atom_to_list(N) ||
|
Payload = list_to_binary(string:join([atom_to_list(N) ||
|
||||||
N <- emqttd_mnesia:running_nodes()], ",")),
|
N <- emqttd_mnesia:running_nodes()], ",")),
|
||||||
|
|
|
@ -243,7 +243,7 @@ init([]) ->
|
||||||
% Init metrics
|
% Init metrics
|
||||||
[create_metric(Metric) || Metric <- Metrics],
|
[create_metric(Metric) || Metric <- Metrics],
|
||||||
% $SYS Topics for metrics
|
% $SYS Topics for metrics
|
||||||
[ok = emqttd:create(topic, metric_topic(Topic)) || {_, Topic} <- Metrics],
|
% [ok = emqttd:create(topic, metric_topic(Topic)) || {_, Topic} <- Metrics],
|
||||||
% Tick to publish metrics
|
% Tick to publish metrics
|
||||||
{ok, #state{tick_tref = emqttd_broker:start_tick(tick)}, hibernate}.
|
{ok, #state{tick_tref = emqttd_broker:start_tick(tick)}, hibernate}.
|
||||||
|
|
||||||
|
|
|
@ -122,7 +122,7 @@ init([]) ->
|
||||||
Topics = ?SYSTOP_CLIENTS ++ ?SYSTOP_SESSIONS ++ ?SYSTOP_PUBSUB ++ ?SYSTOP_RETAINED,
|
Topics = ?SYSTOP_CLIENTS ++ ?SYSTOP_SESSIONS ++ ?SYSTOP_PUBSUB ++ ?SYSTOP_RETAINED,
|
||||||
ets:insert(?STATS_TAB, [{Topic, 0} || Topic <- Topics]),
|
ets:insert(?STATS_TAB, [{Topic, 0} || Topic <- Topics]),
|
||||||
% Create $SYS Topics
|
% Create $SYS Topics
|
||||||
[ok = emqttd:create(topic, stats_topic(Topic)) || Topic <- Topics],
|
% [ok = emqttd:create(topic, stats_topic(Topic)) || Topic <- Topics],
|
||||||
% Tick to publish stats
|
% Tick to publish stats
|
||||||
{ok, #state{tick_tref = emqttd_broker:start_tick(tick)}, hibernate}.
|
{ok, #state{tick_tref = emqttd_broker:start_tick(tick)}, hibernate}.
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue