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
Bump mysql-connector to 6.x #18
Comments
I've replied on the pull request -- let's continue the conversation there. The methods in SslSocketFactory are package private on purpose since the API of that class can change any time without notice. If it was not package private, we would have to be careful about any method changes. It's not likely that the MySQL socket factory interface is going to change again any time soon so I don't see a lot of value in exposing SslSocketFactory outside the library. Let me know if you have some other uses in mind. |
Thanks for your reply! The methods / API of the SslSocketFactory are mostly private / unused / unneeded by other classes - the only one that really seems to be needed for me to implement a SocketFactory is this: this.socket = SslSocketFactory.getInstance().create(instanceName); This basically seems to be a singleton pattern, so I don't see a huge problem in exposing this functionality to other classes - it returns a socket that is properly authenticated to be used (in this case) for SQL. If this was available it would be easy to create my own SocketFactory without having to pull request here. The real heavy lifting ins done in SslSocketFactory, not in your implementation SocketFactory. Or am I completely missing the point? |
SocketFactory interface. This was done by splitting the project into multiple modules: core - mysql driver agnostic library code connector-j-5 - module for the 5.x version of Connector/J connector-j-6 - module for the 6.x version of Connector/J The connector-j-6 module publishes a new artifact with id 'mysql-socket-factory-connector-j-6'. Fixes GoogleCloudPlatform#18.
SocketFactory interface. This was done by splitting the project into multiple modules: core - mysql driver agnostic library code connector-j-5 - module for the 5.x version of Connector/J connector-j-6 - module for the 6.x version of Connector/J The connector-j-6 module publishes a new artifact with id 'mysql-socket-factory-connector-j-6'. Fixes GoogleCloudPlatform#18.
SocketFactory interface. This was done by splitting the project into multiple modules: core - mysql driver agnostic library code connector-j-5 - module for the 5.x version of Connector/J connector-j-6 - module for the 6.x version of Connector/J The connector-j-6 module publishes a new artifact with id 'mysql-socket-factory-connector-j-6'. Fixes GoogleCloudPlatform#18.
SocketFactory interface. This was done by splitting the project into multiple modules: core - mysql driver agnostic library code connector-j-5 - module for the 5.x version of Connector/J connector-j-6 - module for the 6.x version of Connector/J The connector-j-6 module publishes a new artifact with id 'mysql-socket-factory-connector-j-6'. Fixes GoogleCloudPlatform#18.
Great, thanks! Will check it out. |
Can you bump the sql-connector to the latest version? We were happy with your library because it allowed us to get away from this approach here (http://labs.unacast.com/2016/02/18/cloud-sql-on-google-container-engine/), but as we are now bumping our dependencies it fails and we seem forced to revert back, increasing build time and container complexity / responsibilities.
The error is
java.lang.NoClassDefFoundError: com/mysql/jdbc/SocketFactory
. I believe it is pretty simple - the functionality is still present in 6.X, it just put in another package:com.mysql.cj.api.io.SocketFactory
On a side note: Is there any rationale why the
com.google.cloud.sql.mysql.SslSocketFactory
is package local? It would be a lot easier for me to just rewrite this by creating my own SocketFactory without having to copy and duplicate your SSL and authentication stuff.The text was updated successfully, but these errors were encountered: