fix(stomp): not allow to create same subscriptions
This commit is contained in:
parent
3c91a65804
commit
0483c6afef
|
@ -1,6 +1,6 @@
|
||||||
{application, emqx_gateway_stomp, [
|
{application, emqx_gateway_stomp, [
|
||||||
{description, "Stomp Gateway"},
|
{description, "Stomp Gateway"},
|
||||||
{vsn, "0.1.1"},
|
{vsn, "0.1.2"},
|
||||||
{registered, []},
|
{registered, []},
|
||||||
{applications, [kernel, stdlib, emqx, emqx_gateway]},
|
{applications, [kernel, stdlib, emqx, emqx_gateway]},
|
||||||
{env, []},
|
{env, []},
|
||||||
|
|
|
@ -695,12 +695,15 @@ check_subscribed_status(
|
||||||
) ->
|
) ->
|
||||||
MountedTopic = emqx_mountpoint:mount(Mountpoint, ParsedTopic),
|
MountedTopic = emqx_mountpoint:mount(Mountpoint, ParsedTopic),
|
||||||
case lists:keyfind(SubId, 1, Subs) of
|
case lists:keyfind(SubId, 1, Subs) of
|
||||||
{SubId, MountedTopic, _Ack, _} ->
|
{SubId, _MountedTopic, _Ack, _} ->
|
||||||
ok;
|
|
||||||
{SubId, _OtherTopic, _Ack, _} ->
|
|
||||||
{error, subscription_id_inused};
|
{error, subscription_id_inused};
|
||||||
false ->
|
false ->
|
||||||
ok
|
case lists:keyfind(MountedTopic, 2, Subs) of
|
||||||
|
{_OtherSubId, MountedTopic, _Ack, _} ->
|
||||||
|
{error, subscription_inused};
|
||||||
|
false ->
|
||||||
|
ok
|
||||||
|
end
|
||||||
end.
|
end.
|
||||||
|
|
||||||
check_sub_acl(
|
check_sub_acl(
|
||||||
|
|
Loading…
Reference in New Issue