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.
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
Specific example use cases that wouldn't need to recreate the channel: publishing without publisher confirms and basic.get.