Hello All,
Recently from my application I am getting this error:
System.InvalidOperationException: The channel was closed: AMQP close-reason, initiated by Peer, code=406, text='PRECONDITION_FAILED - delivery acknowledgement on channel 1 timed out. Timeout value used: 1800000 ms. This timeout value can be configured, see consumers doc guide to learn more', classId=0, methodId=0 1
at MassTransit.RabbitMqTransport.RabbitMqReceiveLockContext.Complete() in /_/src/Transports/MassTransit.RabbitMqTransport/RabbitMqTransport/RabbitMqReceiveLockContext.cs:line 30
at MassTransit.Transports.PendingReceiveLockContext.Execute(Func`2 action) in /_/src/MassTransit/Transports/PendingReceiveLockContext.cs:line 83
at MassTransit.Transports.ReceivePipeDispatcher.Dispatch(ReceiveContext context, ReceiveLockContext receiveLock) in /_/src/MassTransit/Transports/ReceivePipeDispatcher.cs:line 71
at MassTransit.Transports.ReceivePipeDispatcher.Dispatch(ReceiveContext context, ReceiveLockContext receiveLock) in /_/src/MassTransit/Transports/ReceivePipeDispatcher.cs:line 108
at MassTransit.Transports.ReceivePipeDispatcher.Dispatch(ReceiveContext context, ReceiveLockContext receiveLock) in /_/src/MassTransit/Transports/ReceivePipeDispatcher.cs:line 115
at MassTransit.RabbitMqTransport.RabbitMqBasicConsumer.<>c__DisplayClass21_0.<<HandleBasicDeliver>b__0>d.MoveNext() in /_/src/Transports/MassTransit.RabbitMqTransport/RabbitMqTransport/RabbitMqBasicConsumer.cs:line 168
I was using rabbitmq 3.11.11 , after seeing the documentation i figured out that we can do per-queue delivery timeouts using a policy so i upgraded to Rabbitmq latest version (i.e 3.12.7).
According to the documentation I was told to do this
# override consumer timeout for a group of queues using a policy
rabbitmqctl set_policy queue_consumer_timeout "with_delivery_timeout\.*" '{"consumer_timeout":3600000}' --apply-to classic_queues
so this is my command :-
rabbitmqctl set_policy queue_consumer_timeout "^GemcatCleaning$" "{\"consumer_timeout\":7200000}" --apply-to classic_queues
when trying this i am getting the error:-
Setting policy "queue_consumer_timeout" for pattern "^GemcatCleaning$" to "{"consumer_timeout":7200000}" with priority "0" for vhost "/" ...
Error:
Validation failed
[{<<"consumer_timeout">>,3600000}] are not recognised policy settings
Can you provide me any workaround or solution to increase my delivery ack timeout from 30 mins to 2 hrs for that particular queue????
Thanks
Bhanoday