You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
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.
The ConnectionFactory class has dozens of parameters.
It can be overwhelming to configure, especially
for tricky topics like TLS where the parameters are among
the other dozens, without clear way to find them.
This commit introduces an API to simplify the configuration
of ConnectionFactory. It is fluent, uses modern API (e.g. Duration
for timeout), and groups common settings in sub-API.
The configuration API will be introduced in 5.x, marked as experimental,
and refined in minor releases.
The traditional setter-based API will be marked deprecated 6.x and
removed in 7.x.
Benefits of the new configuration API:
* fluent, the method calls can be chained and formatted in a logical
way (it does not have to be 1 line = 1 parameter).
* the different timeout settings use the Duration type, instead of
int. It is no longer necessary to know the unit (seconds or
milliseconds).
* parameters for the same topic are grouped into dedicated configuration
API (TLS, NIO, OAuth2, recovery, etc). It makes it much easier to
configure those parts, as available settings will show up automatically
in the IDE auto-completion, and not among the other dozens of settings.
* more opinionated but easier configuration. OAuth2 is an example:
no need to use builder classes with very long names, the refresh service
part is also in the #oauth2() sub-configuration, whereas it's a
separate setter in ConnectionFactory.
References #608, #1139
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
The text was updated successfully, but these errors were encountered: