From 3e6f1b7c78bedd80c9a7e39a60bf3caa244e8f9e Mon Sep 17 00:00:00 2001 From: Miguel Bautista Date: Tue, 11 May 2021 18:47:50 -0400 Subject: [PATCH] declare exchange before binding --- consume.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/consume.go b/consume.go index a0fc1dd..f23f18c 100644 --- a/consume.go +++ b/consume.go @@ -189,30 +189,30 @@ func WithConsumeOptionsBindingExchangeKind(kind string) func(*ConsumeOptions) { } // WithConsumeOptionsBindingExchangeDurable returns a function that sets the binding exchange durable flag -func WithConsumeOptionsBindingExchangeDurable(durable bool) func(*ConsumeOptions) { +func WithConsumeOptionsBindingExchangeDurable() func(*ConsumeOptions) { return func(options *ConsumeOptions) { - getBindingExchangeOptionsOrSetDefault(options).Durable = durable + getBindingExchangeOptionsOrSetDefault(options).Durable = true } } // WithConsumeOptionsBindingExchangeAutoDelete returns a function that sets the binding exchange autoDelete flag -func WithConsumeOptionsBindingExchangeAutoDelete(autoDelete bool) func(*ConsumeOptions) { +func WithConsumeOptionsBindingExchangeAutoDelete() func(*ConsumeOptions) { return func(options *ConsumeOptions) { - getBindingExchangeOptionsOrSetDefault(options).AutoDelete = autoDelete + getBindingExchangeOptionsOrSetDefault(options).AutoDelete = true } } // WithConsumeOptionsBindingExchangeInternal returns a function that sets the binding exchange internal flag -func WithConsumeOptionsBindingExchangeInternal(internal bool) func(*ConsumeOptions) { +func WithConsumeOptionsBindingExchangeInternal() func(*ConsumeOptions) { return func(options *ConsumeOptions) { - getBindingExchangeOptionsOrSetDefault(options).Internal = internal + getBindingExchangeOptionsOrSetDefault(options).Internal = true } } // WithConsumeOptionsBindingExchangeNoWait returns a function that sets the binding exchange noWait flag -func WithConsumeOptionsBindingExchangeNoWait(noWait bool) func(*ConsumeOptions) { +func WithConsumeOptionsBindingExchangeNoWait() func(*ConsumeOptions) { return func(options *ConsumeOptions) { - getBindingExchangeOptionsOrSetDefault(options).NoWait = noWait + getBindingExchangeOptionsOrSetDefault(options).NoWait = true } }