Skip to content

Reuse safe channels #45

@jadencodes

Description

@jadencodes

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions