From fc0f57073d75a4ba11c44a3aec1c6c287ea1024e Mon Sep 17 00:00:00 2001 From: turtled Date: Sat, 25 Aug 2018 14:32:32 +0800 Subject: [PATCH] Fix share sub dispatch fail --- src/emqx_shared_sub.erl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/emqx_shared_sub.erl b/src/emqx_shared_sub.erl index 5194de9d4..e8a9fac10 100644 --- a/src/emqx_shared_sub.erl +++ b/src/emqx_shared_sub.erl @@ -81,7 +81,7 @@ record(Group, Topic, SubPid) -> #emqx_shared_subscription{group = Group, topic = Topic, subpid = SubPid}. %% TODO: dispatch strategy, ensure the delivery... -dispatch(Group, Topic, Delivery = #delivery{message = Msg, flows = Flows}) -> +dispatch({Group, _Node}, Topic, Delivery = #delivery{message = Msg, flows = Flows}) -> case pick(subscribers(Group, Topic)) of false -> Delivery; SubPid -> SubPid ! {dispatch, Topic, Msg}, @@ -98,7 +98,6 @@ pick(SubPids) -> subscribers(Group, Topic) -> ets:select(?TAB, [{{emqx_shared_subscription, Group, Topic, '$1'}, [], ['$1']}]). - %%----------------------------------------------------------------------------- %% gen_server callbacks %%-----------------------------------------------------------------------------