Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spike on fluent ConnectionFactory configuration API #1242

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Commits on Jan 29, 2024

  1. Start spike on fluent ConnectionFactory configuration API

    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
    acogoluegnes committed Jan 29, 2024
    Configuration menu
    Copy the full SHA
    25b9036 View commit details
    Browse the repository at this point in the history