Fix share sub dispatch fail
This commit is contained in:
parent
36647b641f
commit
fc0f57073d
|
@ -81,7 +81,7 @@ record(Group, Topic, SubPid) ->
|
||||||
#emqx_shared_subscription{group = Group, topic = Topic, subpid = SubPid}.
|
#emqx_shared_subscription{group = Group, topic = Topic, subpid = SubPid}.
|
||||||
|
|
||||||
%% TODO: dispatch strategy, ensure the delivery...
|
%% 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
|
case pick(subscribers(Group, Topic)) of
|
||||||
false -> Delivery;
|
false -> Delivery;
|
||||||
SubPid -> SubPid ! {dispatch, Topic, Msg},
|
SubPid -> SubPid ! {dispatch, Topic, Msg},
|
||||||
|
@ -98,7 +98,6 @@ pick(SubPids) ->
|
||||||
|
|
||||||
subscribers(Group, Topic) ->
|
subscribers(Group, Topic) ->
|
||||||
ets:select(?TAB, [{{emqx_shared_subscription, Group, Topic, '$1'}, [], ['$1']}]).
|
ets:select(?TAB, [{{emqx_shared_subscription, Group, Topic, '$1'}, [], ['$1']}]).
|
||||||
|
|
||||||
%%-----------------------------------------------------------------------------
|
%%-----------------------------------------------------------------------------
|
||||||
%% gen_server callbacks
|
%% gen_server callbacks
|
||||||
%%-----------------------------------------------------------------------------
|
%%-----------------------------------------------------------------------------
|
||||||
|
|
Loading…
Reference in New Issue