rabbitmq-java-client icon indicating copy to clipboard operation
rabbitmq-java-client copied to clipboard

Make ConnectionFactory easier to use

Open acogoluegnes opened this issue 5 years ago • 3 comments

Related to #330.

Many settings have been added to ConnectionFactory over the years, making it somewhat harder to configure. It's for instance easy to omit an important option when setting TLS, because the different TLS-related options are scattered: ConnectionFactory#useSslProtocol, ConnectionFactory#setSslContextFactory, ConnectionFactory#enableHostnameVerification. Same thing for NIO (mitigated by NioParams).

A more "use-case oriented", less JavaBeans-like way could improve the situation, e.g.:

cf.nio().executor(myNioExecutor).socketChannelConfigurator(configurator) // NIO configuration
  .connectionFactory() // going back to the connection factory (call may be avoided with syntax trick)
  .tls().context(sslContext).hostnameVerification(true); // TLS configuration

Not longer useful configuration methods would be deprecated and scheduled for removal in 7.0.0.

acogoluegnes avatar Apr 03 '19 08:04 acogoluegnes

Hey,

I would like to contribute to this project. I was wondering if this issue is still actionable and can I take this up

mudit-saxena avatar May 30 '20 11:05 mudit-saxena

@mudit-saxena you can take this up. We only have a single example but if you can run with it, feel free to submit a PR and we will discuss what you think such "fluent API" might look like. Thank you!

michaelklishin avatar May 30 '20 14:05 michaelklishin

This does not have to go into 6.0, as it could be introduced as a backward-compatible change. We could get rid of deprecated ("direct") configuration methods in 6.0 then.

acogoluegnes avatar May 22 '23 07:05 acogoluegnes