Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Separate publisher/consumer connections for rabbitmq #679

Open
ttshivers opened this issue Jan 16, 2024 · 8 comments
Open

Separate publisher/consumer connections for rabbitmq #679

ttshivers opened this issue Jan 16, 2024 · 8 comments
Labels
enhancement New feature or request

Comments

@ttshivers
Copy link
Contributor

According to best practices, it is good to use separate connections entirely for publishers and consumers so RabbitMQ can apply backpressure on the tcp connections if the publisher is sending too many messages but still allow consumers to operate properly and send back acks.

https://www.cloudamqp.com/blog/part1-rabbitmq-best-practice.html#separate-connections-for-publisher-and-consumer

@underfisk
Copy link
Contributor

@ttshivers I like this idea! Is there any action item/follow up that us, the library Authors can do? Updating documentation? Improving the module API?
Feel free to propose and i'd be happy to review/discuss

@underfisk underfisk added the enhancement New feature or request label Jan 16, 2024
@ttshivers
Copy link
Contributor Author

I think this could be accomplished with an internal change where the publish method uses a separate connection that we would also need to set up.

@underfisk
Copy link
Contributor

I think this could be accomplished with an internal change where the publish method uses a separate connection that we would also need to set up.

Do you have a change proposal in mind or something you could show off in a PR? I haven't used the rmq package in awhile so I'm open to suggestions

@ttshivers
Copy link
Contributor Author

I think this could be accomplished with an internal change where the publish method uses a separate connection that we would also need to set up.

Do you have a change proposal in mind or something you could show off in a PR? I haven't used the rmq package in awhile so I'm open to suggestions

Sure. Also, I think this may involve changing the names of many public properties to properly differentiate between the consumer and producer connections.

get connection(): Connection {

would become consumerConnection and there would also be a publisherConnection.

@underfisk
Copy link
Contributor

I think this could be accomplished with an internal change where the publish method uses a separate connection that we would also need to set up.

Do you have a change proposal in mind or something you could show off in a PR? I haven't used the rmq package in awhile so I'm open to suggestions

Sure. Also, I think this may involve changing the names of many public properties to properly differentiate between the consumer and producer connections.

get connection(): Connection {

would become consumerConnection and there would also be a publisherConnection.

I like that idea! I'm not against a change of API if it's for the better, again this API should evolve and there's room for improvement

@ttshivers
Copy link
Contributor Author

One thing I'm considering as well is cases where only consumption is used so a publisher channel wouldn't be needed.

Separate connections can be created with the current state by registering the module multiple times so perhaps that might be the way to go.

@underfisk
Copy link
Contributor

A while ago i had the idea of "connection pooling" because it felt that some connections were being recreated and could potentially be re-used but if you do have an RFC feel free to propose, don't feel limited

@irarayjenkins
Copy link

Has there been any movement on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants