Allow controlling nack requeue on plugin level

This commit is contained in:
Goran Udosic 2020-03-19 09:18:55 +01:00
parent 594d331904
commit 08f7512b80
3 changed files with 11 additions and 1 deletions

View File

@ -9,6 +9,7 @@ define PROJECT_ENV
{passcode, <<"guest">>}]},
{default_vhost, <<"/">>},
{default_topic_exchange, <<"amq.topic">>},
{default_nack_requeue, true},
{ssl_cert_login, false},
{implicit_connect, false},
{tcp_listeners, [61613]},

View File

@ -219,3 +219,12 @@ end}.
{mapping, "stomp.hide_server_info", "rabbitmq_stomp.hide_server_info",
[{datatype, {enum, [true, false]}}]}.
%% Whether or not to always requeue the message on nack
%% If not set then coordinated by the usage of the frame "requeue" header
%% Useful when you are not fully controlling the STOMP consumer implementation
%%
%% {default_nack_requeue, false}
{mapping, "stomp.default_nack_requeue", "rabbitmq_stomp.default_nack_requeue",
[{datatype, {enum, [true, false]}}]}.

View File

@ -408,7 +408,7 @@ ack_action(Command, Frame,
{ok, {ConsumerTag, _SessionId, DeliveryTag}} ->
case maps:find(ConsumerTag, Subs) of
{ok, Sub} ->
Requeue = rabbit_stomp_frame:boolean_header(Frame, "requeue", true),
Requeue = rabbit_stomp_frame:boolean_header(Frame, "requeue", application:get_env(rabbitmq_stomp, default_nack_requeue, true)),
Method = MethodFun(DeliveryTag, Sub, Requeue),
case transactional(Frame) of
{yes, Transaction} ->