diff --git a/Makefile b/Makefile index 196d2f6..b317856 100644 --- a/Makefile +++ b/Makefile @@ -48,7 +48,7 @@ update-readme-badge: # pkg.go.dev documentation is updated via go get update-proxy-cache: - @GOPROXY=https://proxy.golang.org go get github.com/danlock/rmq + @GOPROXY=https://proxy.golang.org go get -u github.com/danlock/rmq release: @$(MAKE) deps diff --git a/consumer.go b/consumer.go index 25689fa..0e63908 100644 --- a/consumer.go +++ b/consumer.go @@ -154,8 +154,9 @@ func (c *Consumer) declareAndConsume(ctx context.Context, mqChan *amqp.Channel) } } - // TODO: https://github.com/rabbitmq/amqp091-go/pull/192 has merged a Channel.ConsumeWithContext, which should be used here instead when we can - deliveries, err := mqChan.Consume( + // https://github.com/rabbitmq/amqp091-go/pull/192 Channel.ConsumeWithContext doesn't hold up under scrutiny. The actual network call doesn't respect the passed in context. + deliveries, err := mqChan.ConsumeWithContext( + ctx, c.config.Queue.Name, c.config.Consume.Consumer, c.config.Consume.AutoAck, diff --git a/go.mod b/go.mod index 99fb646..fce3aeb 100644 --- a/go.mod +++ b/go.mod @@ -2,4 +2,4 @@ module github.com/danlock/rmq go 1.21 -require github.com/rabbitmq/amqp091-go v1.8.1 +require github.com/rabbitmq/amqp091-go v1.9.0 diff --git a/go.sum b/go.sum index 33d48e1..357567e 100644 --- a/go.sum +++ b/go.sum @@ -6,6 +6,8 @@ github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/rabbitmq/amqp091-go v1.8.1 h1:RejT1SBUim5doqcL6s7iN6SBmsQqyTgXb1xMlH0h1hA= github.com/rabbitmq/amqp091-go v1.8.1/go.mod h1:+jPrT9iY2eLjRaMSRHUhc3z14E/l85kv/f+6luSD3pc= +github.com/rabbitmq/amqp091-go v1.9.0 h1:qrQtyzB4H8BQgEuJwhmVQqVHB9O4+MNDJCCAcpc3Aoo= +github.com/rabbitmq/amqp091-go v1.9.0/go.mod h1:+jPrT9iY2eLjRaMSRHUhc3z14E/l85kv/f+6luSD3pc= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=