fix(sessds): Graceful handling of shared subscription error
This commit is contained in:
parent
088c44465b
commit
c645cfa5d6
|
@ -337,6 +337,13 @@ print_session(ClientId) ->
|
||||||
|
|
||||||
-spec subscribe(topic_filter(), emqx_types:subopts(), session()) ->
|
-spec subscribe(topic_filter(), emqx_types:subopts(), session()) ->
|
||||||
{ok, session()} | {error, emqx_types:reason_code()}.
|
{ok, session()} | {error, emqx_types:reason_code()}.
|
||||||
|
subscribe(
|
||||||
|
#share{},
|
||||||
|
_SubOpts,
|
||||||
|
_Session
|
||||||
|
) ->
|
||||||
|
%% TODO: Shared subscriptions are not supported yet:
|
||||||
|
{error, ?RC_SHARED_SUBSCRIPTIONS_NOT_SUPPORTED};
|
||||||
subscribe(
|
subscribe(
|
||||||
TopicFilter,
|
TopicFilter,
|
||||||
SubOpts,
|
SubOpts,
|
||||||
|
@ -421,6 +428,9 @@ do_unsubscribe(SessionId, TopicFilter, Subscription = #{id := SubId}, S0) ->
|
||||||
|
|
||||||
-spec get_subscription(topic_filter(), session()) ->
|
-spec get_subscription(topic_filter(), session()) ->
|
||||||
emqx_types:subopts() | undefined.
|
emqx_types:subopts() | undefined.
|
||||||
|
get_subscription(#share{}, _) ->
|
||||||
|
%% TODO: shared subscriptions are not supported yet:
|
||||||
|
undefined;
|
||||||
get_subscription(TopicFilter, #{s := S}) ->
|
get_subscription(TopicFilter, #{s := S}) ->
|
||||||
case emqx_persistent_session_ds_subs:lookup(TopicFilter, S) of
|
case emqx_persistent_session_ds_subs:lookup(TopicFilter, S) of
|
||||||
_Subscription = #{props := SubOpts} ->
|
_Subscription = #{props := SubOpts} ->
|
||||||
|
|
Loading…
Reference in New Issue