rabbitmq_streams: Check rabbit_queue_types is_enabled/0 during declare (#14699)
Trigger a 4.3.x alpha release build / trigger_alpha_build (push) Waiting to run Details
Test (make) / Build and Xref (1.18, 26) (push) Waiting to run Details
Test (make) / Build and Xref (1.18, 27) (push) Waiting to run Details
Test (make) / Build and Xref (1.18, 28) (push) Waiting to run Details
Test (make) / Test (1.18, 28, khepri) (push) Waiting to run Details
Test (make) / Test (1.18, 28, mnesia) (push) Waiting to run Details
Test (make) / Test mixed clusters (1.18, 28, khepri) (push) Waiting to run Details
Test (make) / Test mixed clusters (1.18, 28, mnesia) (push) Waiting to run Details
Test (make) / Type check (1.18, 28) (push) Waiting to run Details

`rabbit_amqqueue:declare/7` consults the `is_enabled/0` callback of
`rabbit_queue_type` before attempting to create a queue.
`rabbit_stream_manager` emulates `rabbit_amqqueue:declare/7` rather
than calling it directly. To align with the `is_enabled/0` check in
`rabbit_amqqueue:declare/7`, `rabbit_stream_manager` needs to check
the callback during stream creation.
This commit is contained in:
Michael Davis 2025-10-06 18:05:23 -04:00 committed by GitHub
parent cae2b4b038
commit 1c264fa471
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 0 deletions

View File

@ -47,10 +47,13 @@ create(VirtualHost, Reference, Arguments, Username) ->
StreamQueueArguments = stream_queue_arguments(Arguments), StreamQueueArguments = stream_queue_arguments(Arguments),
maybe maybe
ok ?= validate_stream_queue_arguments(StreamQueueArguments), ok ?= validate_stream_queue_arguments(StreamQueueArguments),
true ?= rabbit_stream_queue:is_enabled(),
do_create_stream(VirtualHost, Reference, StreamQueueArguments, Username) do_create_stream(VirtualHost, Reference, StreamQueueArguments, Username)
else else
error -> error ->
{error, validation_failed}; {error, validation_failed};
false ->
{error, validation_failed};
{error, _} = Err -> {error, _} = Err ->
Err Err
end. end.