houseofcat / turbocookedrabbit

A user friendly RabbitMQ library written in Golang.
MIT License
107 stars 20 forks source link

New functions to expose Errors from Connection Pool and LetterId from RabbitService #9

Closed jing-li-rocos closed 4 years ago

jing-li-rocos commented 4 years ago

Hi, this is a great RabbitMQ library, we are looking at deploying it to production.

Meanwhile, we have a scenario which requires to extend your library to support synchronized publish with confirmation. We plan to do the extension at our side first. However, we need 2 additional public functions from Connection Pool and Rabbit Service.

houseofcat commented 4 years ago

CorrelationId == Metadata, put whatever extra Identifier i.e. CorrelationID in the Metadata field. It would also break backwards compatibility with other users to add yet another identifier just for your use case.

Metadata can be added to the Envelope as it is not there so that can be incorporated there if you would like.

The ConnectionPool will need some thinking to be able to provide an alternative ConnectionPool that collects errors. As if any current user would not be subscribed to an ever increasing chan err and thus have a memory leak.

Perhaps provide an optional ErrorHandler would be the best approach. I will think on this and get back to you.

jing-li-rocos commented 4 years ago

Ah, I am so sorry. I pushed other commits into our fork and forgot the PR was still on. Let me fix this.

houseofcat commented 4 years ago

I will provide an ErrorHandler ConnectionPool if you still need it, I can see the value there for visibility reasons.

jing-li-rocos commented 4 years ago

I will provide an ErrorHandler ConnectionPool if you still need it, I can see the value there for visibility reason

Thanks so much, we do need it.