-
Notifications
You must be signed in to change notification settings - Fork 116
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
ksql modifications: SSL support, fix URL handling #292
Conversation
Thanks a lot for your contribution @schocco I appreciate it a ton! I will let some comments in the next few minutes. |
throw new ConfigurationException(config.getString(PLATFORM_SERVER_KSQL_URL) + " is not a valid KSQL URL"); | ||
} | ||
} | ||
return null; |
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.
I would probably suggest to return an optional, instead of null, right?
src/main/java/com/purbon/kafka/topology/api/ksql/KsqlApiClient.java
Outdated
Show resolved
Hide resolved
src/main/java/com/purbon/kafka/topology/api/ksql/KsqlApiClient.java
Outdated
Show resolved
Hide resolved
.setPort(server.getPort()); | ||
if (server.getProtocol() != null && server.getProtocol().equals(HTTPS)) { | ||
options.setUseTls(true); | ||
options.setUseAlpn(true); |
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.
I wonder how this property will behave with old or less up to using old or less up to date TLS support. What do you think?
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.
I only tested this on CP 6.0.2 with JDK11 so far - it probably makes sense to provide sensible defaults and allow users to override them with the properties file.
Also an option for setting truststores/keystores might be needed as additional configuration option as mentioned in #287
These additional properties should then probably end up in platform.server.ksql.XXX
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.
I love the idea of adding it as config option 👍
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.
additional configuration options are now present and documented in docs/futures/what-ksql-management.rst
import java.io.IOException; | ||
|
||
public class ConfigurationException extends IOException { | ||
public class ConfigurationException extends RuntimeException { |
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.
can you please elaborate a bit on this change to RuntimeException?
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.
The previously checked exception was never handled explicitly but just rethrown, so I changed it to an unchecked one (and I wanted to use the ConfigurationException when a URL value could not be parsed without adding a throws clause in the getter in Configuration#getKSQLServer)
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.
I wonder, if instead of making it runtime, we could keep it as an exception and properly handle it. Not sure about your experiences, but I kinda prefer always explicit exception handling as much as possible. What do you think?
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.
I think in the end the question is: Can we properly handle or solve the issue in a catch block when the user provided an invalid configuration?
There is a little section for checked vs unchecked here:
https://docs.oracle.com/javase/tutorial/essential/exceptions/runtime.html
I prefer to go into platform.server.ksql, topology is more for the cluster description description. |
yo should need to add support this in the ksql test containers, it would look something like https://github.com/confluentinc/cp-demo/blob/6.1.1-post/docker-compose.yml#L824-L831 |
* add documentation for new ksql properties and introduce KsqlClientConfig class to bundle ksql related options format code * add wait strategy in to ksql container to get rid of Thread.sleep call in integration tests * add basic support for TLS and fix handling ksql urls kafka-ops#288 kafka-ops#287 * add missing toString method kafka-ops#289
* ensure verifyHost defaults to true * testcontainers: wait for log message instead of polling ksql /info endpoint * refactor to use BasicAuth class in JulieHttpClient * add integration test for ksqldb with TLS
88240c4
to
ad83b4a
Compare
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
feel free to reopen, I should really kick this github bot :-( I apologies. I will follow up soon, sorry this last months has been not very operational for my open source efforts. |
Does this PR introduce a breaking change? (What changes might users need to make in their application due to this PR?)
none
questions/discussion:
topology.*
orplatform.server.ksql
?getMdsServer
andgetConfluentSchemaRegistryUrl
be refactored to also return URL as a type for consistency?