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

Reuse safe channels #45

Open
jadencodes opened this issue May 11, 2020 · 0 comments
Open

Reuse safe channels #45

jadencodes opened this issue May 11, 2020 · 0 comments

Comments

@jadencodes
Copy link

Hi there, me again! Playing on my fork of this, I realized that the channels are not being reused and thought this was a bug but then saw in the source that on checkin they are specifically replaced in the pool.

While reusing the connections is a large help by saving the connection handshake, I believe in a lot of cases we can gain performance by reusing channels. There are of course certain times that the channel must be recreated.

From the cloudamqp crystal version of pooling: https://github.com/cloudamqp/amqproxy

Only "safe" channels are reused, that is channels where only Basic Publish or Basic Get (with no_ack) has occurred. Any channels who has subscribed to a queue will be closed when the client disconnects. However, the connection to the upstream AMQP server are always kept open and can be reused.

Specific example use cases that wouldn't need to recreate the channel: publishing without publisher confirms and basic.get.

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

No branches or pull requests

1 participant