Return error if SAC has no name
Single active consumer must have a name, which is used as the reference for storing offsets and as the name of the group the consumer belongs to in case the stream is a partition of a super stream. References #3753
This commit is contained in:
parent
4cb814dd1c
commit
ee79237bf6
|
|
@ -1880,9 +1880,10 @@ handle_frame_post_auth(Transport,
|
|||
Sac = single_active_consumer(Properties),
|
||||
ConsumerName = consumer_name(Properties),
|
||||
%% TODO check consumer name is defined when SAC
|
||||
case {Sac, rabbit_stream_utils:is_sac_ff_enabled()}
|
||||
case {Sac, rabbit_stream_utils:is_sac_ff_enabled(),
|
||||
ConsumerName}
|
||||
of
|
||||
{true, false} ->
|
||||
{true, false, _} ->
|
||||
rabbit_log:warning("Cannot create subcription ~p, stream single active "
|
||||
"consumer feature flag is not enabled",
|
||||
[SubscriptionId]),
|
||||
|
|
@ -1895,6 +1896,19 @@ handle_frame_post_auth(Transport,
|
|||
?PRECONDITION_FAILED,
|
||||
1),
|
||||
{Connection, State};
|
||||
{true, _, undefined} ->
|
||||
rabbit_log:warning("Cannot create subcription ~p, a single active "
|
||||
"consumer must have a name",
|
||||
[SubscriptionId]),
|
||||
response(Transport,
|
||||
Connection,
|
||||
subscribe,
|
||||
CorrelationId,
|
||||
?RESPONSE_CODE_PRECONDITION_FAILED),
|
||||
rabbit_global_counters:increase_protocol_counter(stream,
|
||||
?PRECONDITION_FAILED,
|
||||
1),
|
||||
{Connection, State};
|
||||
_ ->
|
||||
Log = case Sac of
|
||||
true ->
|
||||
|
|
|
|||
Loading…
Reference in New Issue