Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

Incorrect usage of RabbitMQ connections can lead to socket exhaustion #21

Open
@jdtaylor91

Description

Problem

Incorrect usage of RabbitMQ connections can lead to socket exhaustion.

The library doesn't treat RabbitMQ connections as singletons. Every instance of RabbitMQQueueClient created by an application will create a new connection to RabbitMQ.

The recommended approach for RabbitMQ is to share a single connection.

Suggestion

The RabbitMQQueueClient instance should internally cache the connection so that it can be reused for subsequent instances. The connection could be cached by a hash of the RabbitMQQueueClientFactoryOptions to ensure that multiple connections for different RabbitMQ hosts can be supported. Only options that relate to the connection should be used for the hash.

It is recommended that a single connection but multiple channels are used, therefore each instance of RabbitMQQueueClient should still create it's own channel.

References

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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