Skip to content

Commit ee460e0

Browse files
committed
Revert "Removes apache http libraries and replace with azure core httpclient (#335)"
This reverts commit 0057e8f
1 parent 8ff1fb6 commit ee460e0

File tree

59 files changed

+1056
-1180
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+1056
-1180
lines changed

CHANGELOG.md

-9
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
88
### Added
99
- Azure CLI authentication
1010

11-
## [6.0.0] - 2024-03-07
12-
### Changed
13-
- Replaced Apache CloseableHttpClient with configurable azure-core client.
14-
- (Breaking) HttpClientFactory now accepts clients implementing azure-core HttpClient.
15-
- (Breaking) HttpClientProperties and HttpClientPropertiesBuilder now use azure-core ProxyOptions.
16-
- Data client now wraps internal HTTP client.
17-
- Moved HTTP request tracing logic into a builder class.
18-
- Moved HTTP request building logic into a builder class.
19-
2011
## [5.0.5] - 2024-03-06
2112
### Fixed
2213
- Fixed bugs in how ClientRequestProperties' servertimeout is set/get, and aligned the 3 different ways to set/get this option

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ And the SDK will know to use these values automatically.
5959
Alternatively, you can define a proxy programmatically when creating a client, using `HttpClientProperties`:
6060
```java
6161
HttpClientProperties httpClientProperties = HttpClientProperties.builder()
62-
.proxy(new ProxyOptions(ProxyOptions.Type.HTTP, new InetSocketAddress("myproxy.contoso.com", 8080)))
62+
.proxy(new HttpHost("1.2.3.4", 8989))
6363
.build();
6464

6565
Client = ClientFactory.createClient(<engine_connection_string>, httpClientProperties);

data/pom.xml

+11-1
Original file line numberDiff line numberDiff line change
@@ -159,17 +159,27 @@
159159
<groupId>com.azure</groupId>
160160
<artifactId>azure-core</artifactId>
161161
</dependency>
162+
<!-- https://mvnrepository.com/artifact/org.apache.httpcomponents/httpclient -->
162163
<dependency>
163164
<groupId>org.apache.httpcomponents</groupId>
164165
<artifactId>httpclient</artifactId>
165-
<version>${apache.httpclient.version}</version>
166+
<version>${httpclient.version}</version>
166167
<exclusions>
168+
<exclusion>
169+
<artifactId>httpcore</artifactId>
170+
<groupId>org.apache.httpcomponents</groupId>
171+
</exclusion>
167172
<exclusion>
168173
<artifactId>commons-codec</artifactId>
169174
<groupId>org.apache.commons</groupId>
170175
</exclusion>
171176
</exclusions>
172177
</dependency>
178+
<dependency>
179+
<groupId>org.apache.httpcomponents</groupId>
180+
<artifactId>httpcore</artifactId>
181+
<version>${httpcore.version}</version>
182+
</dependency>
173183
<dependency>
174184
<groupId>org.jetbrains</groupId>
175185
<artifactId>annotations</artifactId>

data/src/main/java/com/microsoft/azure/kusto/data/BaseClient.java

-167
This file was deleted.

data/src/main/java/com/microsoft/azure/kusto/data/ClientFactory.java

+6-7
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@
33

44
package com.microsoft.azure.kusto.data;
55

6-
import com.azure.core.http.HttpClient;
76
import com.microsoft.azure.kusto.data.auth.ConnectionStringBuilder;
8-
import com.microsoft.azure.kusto.data.http.HttpClientProperties;
7+
import org.apache.http.impl.client.CloseableHttpClient;
98

109
import java.net.URISyntaxException;
1110

@@ -44,12 +43,12 @@ public static Client createClient(ConnectionStringBuilder csb, HttpClientPropert
4443
* customized with the given properties.
4544
*
4645
* @param csb the connection string builder
47-
* @param client HttpClient client.
46+
* @param client CloseableHttpClient client. It will not be closed when {@link Client#close} is called.
4847
* @return a fully constructed {@linkplain Client} instance
4948
* @throws URISyntaxException if the cluster URL is invalid
5049
*/
51-
public static Client createClient(ConnectionStringBuilder csb, HttpClient client) throws URISyntaxException {
52-
return client == null ? createClient(csb, (HttpClientProperties) null) : new ClientImpl(csb, client);
50+
public static Client createClient(ConnectionStringBuilder csb, CloseableHttpClient client) throws URISyntaxException {
51+
return client == null ? createClient(csb, (HttpClientProperties) null) : new ClientImpl(csb, client, true);
5352
}
5453

5554
/**
@@ -86,7 +85,7 @@ public static StreamingClient createStreamingClient(ConnectionStringBuilder csb,
8685
* @return a fully constructed {@linkplain StreamingClient} instance
8786
* @throws URISyntaxException if the cluster URL is invalid
8887
*/
89-
public static StreamingClient createStreamingClient(ConnectionStringBuilder csb, HttpClient httpClient) throws URISyntaxException {
90-
return new ClientImpl(csb, httpClient);
88+
public static StreamingClient createStreamingClient(ConnectionStringBuilder csb, CloseableHttpClient httpClient) throws URISyntaxException {
89+
return new ClientImpl(csb, httpClient, true);
9190
}
9291
}

0 commit comments

Comments
 (0)