wagslane / go-rabbitmq

A wrapper of streadway/amqp that provides reconnection logic and sane defaults
https://blog.boot.dev/golang/connecting-to-rabbitmq-in-golang-easy/
MIT License
772 stars 126 forks source link

Can we set a consumer timeout? #67

Closed peeeeeem closed 2 years ago

peeeeeem commented 2 years ago

Hello, I read documents about rabbitmq. The default ack timeout for rabbitmq is 30 minutes. So I want to adjust this. Is go-rabbitmq able to set a consumer ack timeout?

fortyanov commented 2 years ago

It works since 0.7.2

    consumer, err := rabbitmq.NewConsumer(
        cfg.Rabbit.URI,
        amqp.Config{},
        rabbitmq.WithConsumerOptionsLogging,
        rabbitmq.WithConsumerOptionsReconnectInterval(5*time.Second),
    )