Allow controlling nack requeue on plugin level
This commit is contained in:
parent
594d331904
commit
08f7512b80
|
|
@ -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]},
|
||||
|
|
|
|||
|
|
@ -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]}}]}.
|
||||
|
|
@ -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} ->
|
||||
|
|
|
|||
Loading…
Reference in New Issue