From 0d0b74c7e902f3f8f760032756b2b8ca52952aa3 Mon Sep 17 00:00:00 2001 From: Victor Castillo <> Date: Tue, 8 Jun 2021 22:23:28 -0500 Subject: [PATCH] Add function WithConsumeOptionsConsumerAutoAck to change the auto acknowledge property, when creating a consumer --- consume_options.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/consume_options.go b/consume_options.go index f6168f8..1c61dbc 100644 --- a/consume_options.go +++ b/consume_options.go @@ -189,6 +189,15 @@ func WithConsumeOptionsConsumerName(consumerName string) func(*ConsumeOptions) { } } + +// WithConsumeOptionsConsumerAutoAck returns a function that sets the auto acknowledge property on the server of this consumer +// if unset the default will be used (false) +func WithConsumeOptionsConsumerAutoAck(autoAck bool) func(*ConsumeOptions) { + return func(options *ConsumeOptions) { + options.ConsumerAutoAck = autoAck + } +} + // WithConsumeOptionsConsumerExclusive sets the consumer to exclusive, which means // the server will ensure that this is the sole consumer // from this queue. When exclusive is false, the server will fairly distribute