ClickHouse / clickhouse-java

ClickHouse Java Clients & JDBC Driver
https://clickhouse.com
Apache License 2.0
1.45k stars 535 forks source link

How can I use HTTP_CLIENT(jdk 17) on clickhouse-http-client #1495

Open Jshen6 opened 11 months ago

Jshen6 commented 11 months ago

the client version:

        <dependency>
            <groupId>com.clickhouse</groupId>
            <artifactId>clickhouse-http-client</artifactId>
            <version>0.5.0</version>
        </dependency>
devurandom commented 6 months ago

Is this a duplicate of https://github.com/ClickHouse/clickhouse-java/issues/1407 ?

devurandom commented 6 months ago

I had success passing a map of {"http_connection_provider": "HTTP_CLIENT"} to com.clickhouse.client.ClickHouseNodes#of(java.lang.String, java.util.Map<?,?>):

(import '(com.clickhouse.client ClickHouseNodes))
(ClickHouseNodes/of endpoint {"http_connection_provider" "HTTP_CLIENT"})

The warning I saw before (WARN [com.clickhouse.client.http.ClickHouseHttpConnectionFactory:164] - Error when creating APACHE_HTTP_CLIENT, fall back to HTTP_URL_CONNECTION, cf. https://github.com/ClickHouse/clickhouse-java/issues/1621#issuecomment-2090879496) was gone afterwards.