Skip to content

Enhance Apache HTTP client #1171

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

Merged
merged 3 commits into from
Jan 3, 2023
Merged

Enhance Apache HTTP client #1171

merged 3 commits into from
Jan 3, 2023

Conversation

zhicwu
Copy link
Contributor

@zhicwu zhicwu commented Jan 3, 2023

This is mainly a follow-up PR for #1146 with below changes:

  • added more socket options and renamed socket_op_ip_tos to socket_ip_tos for consistency @JackyWoo
  • removed ByteArraysInputStream because it's been covered by ClickHouseInputStream
  • enabled more tests for Apache HTTP Client and got failures fixed accordingly

@zhicwu zhicwu merged commit 60b8ca8 into ClickHouse:develop Jan 3, 2023
@zhicwu
Copy link
Contributor Author

zhicwu commented Jan 3, 2023

@JackyWoo, you may use the most recent snapshot at here to validate the changes at your end. I still have some more changes to add, but I believe I can release 0.4.0 in a few days.

@JackyWoo
Copy link
Contributor

JackyWoo commented Jan 4, 2023

@zhicwu I will test it tomorrow

*/
SOCKET_REUSEADDR("socket_reuseaddr", false,
"Whether allows for the reuse of local addresses and ports. "
+ "Only works for client using custom Socket(e.g. TCP client or HTTP provider with custom SocketFactory etc.)."),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zhicwu does custom SocketFactory refers to ApacheHttpConnectionImpl.SocketFactory and ApacheHttpConnectionImpl.SSLSocketFactory ?

I am wondering if it is possible to inject a custom socket factory.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does custom SocketFactory refers to ApacheHttpConnectionImpl.SocketFactory and ApacheHttpConnectionImpl.SSLSocketFactory?

Yes, for now. Ideally we should have a custom socket factory for not only Apache HTTP Client but also others(i.e. NIO-based implementation).

I am wondering if it is possible to inject a custom socket factory.

Sorry it's not supported at this point. What's the purpose of injecting custom socket factory? Is it to use consistent socket options across datasources?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for confirming. Yes, I would like to create a custom socket.

Are you planning to include that feature in the future? Other JDBC drivers(eg. mysql) offer such capabilities.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the suggestion. Just created a separate issue for this, should not be hard to add the feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants