Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 18 additions & 2 deletions deps/rabbit/src/rabbit.erl
Original file line number Diff line number Diff line change
Expand Up @@ -1751,10 +1751,26 @@ persist_static_configuration() ->
[classic_queue_index_v2_segment_entry_count,
classic_queue_store_v2_max_cache_size,
classic_queue_store_v2_check_crc32,
incoming_message_interceptors,
credit_flow_default_credit
incoming_message_interceptors
]),

%% Disallow the following two cases:
%% 1. Negative values
%% 2. MoreCreditAfter greater than InitialCredit
CreditFlowDefaultCredit = case application:get_env(?MODULE, credit_flow_default_credit) of
{ok, {InitialCredit, MoreCreditAfter}}
when is_integer(InitialCredit) andalso
is_integer(MoreCreditAfter) andalso
InitialCredit > 0 andalso
MoreCreditAfter > 0 andalso
MoreCreditAfter < InitialCredit ->
{InitialCredit, MoreCreditAfter};
Other ->
rabbit_log:error("Refusing to boot due to an invalid value of 'rabbit.credit_flow_default_credit'"),
throw({error, {invalid_credit_flow_default_credit_value, Other}})
end,
ok = persistent_term:put(credit_flow_default_credit, CreditFlowDefaultCredit),

%% Disallow 0 as it means unlimited:
%% "If this field is zero or unset, there is no maximum
%% size imposed by the link endpoint." [AMQP 1.0 §2.7.3]
Expand Down
Loading