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
Improving Options with better construction via properties #946
Conversation
scottf
commented
Jul 23, 2023
•
edited
edited
- Allow creation of connections requiring an AuthHandler for JWT to specify the credentials file in a properties files, instead of needing to provide an instance of AuthHandler in code.
- Allow creation of connections requiring an SSL context to specify key and trust store information in a properties files so an SSLContext can be created automatically instead of needing to provide an instance of an SSLContext in code.
- Support properties keys with or without the prefix 'io.nats.client.'
Property | Description |
---|---|
credential.path | Used to set the path to a credentials file to be used in a FileAuthHandler |
keyStore | Property for the keystore path used to create an SSLContext |
trustStore | Property for the truststore path used to create an SSLContext |
keyStorePassword | Property for the keystore password used to create an SSLContext |
trustStorePassword | Property for the truststore password used to create an SSLContext |
tls.algorithm | Property for the algorithm used to create an SSLContext |
…(secure) and PROP_OPENTLS (opentls)
Looks good, really like the per-connection properties here. A minor suggestion would be the ability to build the with options and override. E.g. to set the props file in the builder via method and also be able to set a name, reconnect tries, etc. Best of both worlds. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Docs added to the readme would be swell. :)
I've added a builder setter to take properties. When it comes to the builder, the last one called wins.
|