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

Asynchronous reconnection #160

Closed timandy closed 3 months ago

timandy commented 6 months ago

In #145, asynchronous reconnection was changed to synchronous, and we hope to continue supporting asynchronous recovery reconnection. Or can we split the Run() method into two?

wagslane commented 3 months ago

Are you running into performance issue? Can you elaborate on the use case

timandy commented 3 months ago

Hi @wagslane In the startup phase of the application, start the mq consumption coroutine. If the startGoroutines fails, the app exit with 1 as design. If the start is done with none error, then start the asynchronous reconnection. This is possible in v0.12.3. But then v0.13.0 made breaking changes, which forced us to stay in the old version.

wagslane commented 3 months ago

Sorry I don't think we will be going back to that functionality, but you're free to fork!