Add a "builder" (chained setters) API to the ConnectionFactory class
doukhahmed opened this issue · 2 comments
Is your feature request related to a problem? Please describe.
Add a builder() method to the ConnectionFactory class in the RabbitMQ client library to make it easier to create instances of the ConnectionFactory class with custom configurations.
Describe the solution you'd like
The RabbitMQ client library does not provide a builder() method for the ConnectionFactory class, which can make it difficult to create instances of the ConnectionFactory class with custom configurations. This feature request is to add a builder() method to the ConnectionFactory class that provides a more concise and readable way to configure the ConnectionFactory instance with custom settings.
Describe alternatives you've considered
No response
Additional context
No response
@doukhahmed feel free to submit a pull request to implement this feature. Be sure to include tests. Thanks.
I think we could indeed make the configuration of ConnectionFactory easier. Using the builder terminology would be a bit awkward to me (a builder for a factory), so another term like Configuration could be more appropriate, even though we follow a builder pattern.
It could be fluent and have sub-components for different parts of the configuration, like TLS, this way related settings are not scattered in a large class.
It could be an addition to the library that does not change ConnectionFactory, to avoid breaking changes.