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
805 stars 128 forks source link

publisher resource closure issues #92

Closed Mikaelemmmm closed 1 year ago

Mikaelemmmm commented 1 year ago

Every time I call a business method I "new publisher" to push and then "defer close", the memory keeps going up, I use pprof to check that this is indeed the cause, it is not close in time I'm using pprof to check that this is indeed the cause of the problem. Although I know it is better to initialize "single publisher" and then publish after starting the program, this close does not make sense, it feels like it cannot be released.

image

wagslane commented 1 year ago

Would you mind trying with the latest version on the main branch and letting me know if you're still having issues. Keep in mind you'll need to close the publisher and the connection

wagslane commented 1 year ago

Closing for now, if you can reproduce on the latest version please open a new issue with as much logging/metrics as possible.