Skip to content

Commit d01a687

Browse files
authored
Add Vanilla Netty to client core (Azure#44302)
Add Netty-based ClientCore HttpClient implementation
1 parent 06b6ee5 commit d01a687

19 files changed

Lines changed: 750 additions & 3 deletions

File tree

.vscode/cspell.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,7 @@
202202
"sdk/devcenter/azure-developer-devcenter/**",
203203
"sdk/loadtesting/azure-developer-loadtesting/**",
204204
"sdk/clientcore/core/**",
205+
"sdk/clientcore/http-netty/**",
205206
"sdk/clientcore/http-okhttp3/**",
206207
"sdk/clientcore/annotation-processor/**",
207208
"sdk/clientcore/annotation-processor-test/**",

eng/.docsettings.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ known_content_issues:
9898
- ['sdk/core/README.md', '#3113']
9999
- ['sdk/clientcore/README.md', '#3113']
100100
- ['sdk/clientcore/core/README.md', '#3113']
101+
- ['sdk/clientcore/http-netty/README.md', '#3113']
101102
- ['sdk/clientcore/http-okhttp3/README.md', '#3113']
102103
- ['sdk/clientcore/tools/annotation-processor/README.md', '#3113']
103104
- ['sdk/clientcore/optional-dependency-tests/README.md', '#3113']

eng/versioning/external_dependencies.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,10 @@ io.netty:netty-codec-http;4.1.118.Final
5454
io.netty:netty-codec-http2;4.1.118.Final
5555
io.netty:netty-handler;4.1.118.Final
5656
io.netty:netty-handler-proxy;4.1.118.Final
57+
io.netty:netty-resolver;4.1.118.Final
58+
io.netty:netty-resolver-dns;4.1.118.Final
5759
io.netty:netty-tcnative-boringssl-static;2.0.70.Final
60+
io.netty:netty-transport;4.1.118.Final
5861
io.netty:netty-transport-native-epoll;4.1.118.Final
5962
io.netty:netty-transport-native-unix-common;4.1.118.Final
6063
io.netty:netty-transport-native-kqueue;4.1.118.Final
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Release History
2+
3+
## 1.0.0-beta.1 (Unreleased)
4+
5+
### Features Added
6+
7+
### Breaking Changes
8+
9+
### Bugs Fixed
10+
11+
### Other Changes
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Client Core Netty HTTP plugin library for Java
2+
3+
Client Core Netty HTTP client is a plugin for the `io.clientcore.core` HTTP client API.
4+
5+
## Getting started
6+
7+
### Prerequisites
8+
9+
### Include the package
10+
11+
[//]: # ({x-version-update-start;io.clientcore:http-netty;current})
12+
```xml
13+
<dependency>
14+
<groupId>io.clientcore</groupId>
15+
<artifactId>http-netty</artifactId>
16+
<version>1.0.0-beta.1</version>
17+
</dependency>
18+
```
19+
[//]: # ({x-version-update-end})
20+
21+
## Key concepts
22+
23+
## Examples
24+
25+
### Create a Simple Client
26+
27+
## Troubleshooting
28+
29+
If you encounter any bugs, please file issues via [GitHub Issues](https://github.com/Azure/azure-sdk-for-java/issues/new/choose)
30+
or checkout [StackOverflow for Azure Java SDK](https://stackoverflow.com/questions/tagged/azure-java-sdk).
31+
32+
### Enabling Logging
33+
34+
Client Core libraries for Java provide a consistent logging story to help aid in troubleshooting application errors and
35+
expedite their resolution. The logs produced will capture the flow of an application before reaching the terminal state
36+
to help locate the root issue.
37+
38+
## Contributing
39+
40+
For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md).
41+
42+
1. Fork it
43+
1. Create your feature branch (`git checkout -b my-new-feature`)
44+
1. Commit your changes (`git commit -am 'Add some feature'`)
45+
1. Push to the branch (`git push origin my-new-feature`)
46+
1. Create new Pull Request
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE suppressions PUBLIC "-//Checkstyle//DTD SuppressionFilter Configuration 1.2//EN" "https://checkstyle.org/dtds/suppressions_1_2.dtd">
3+
<!-- This file is generated by the /eng/scripts/linting_suppression_generator.py script. -->
4+
5+
<suppressions>
6+
<suppress files="io.clientcore.http.netty.NettyHttpClientBuilder.java" checks="com.azure.tools.checkstyle.checks.ExternalDependencyExposedCheck" />
7+
<suppress files="io.clientcore.http.netty.NettyHttpClientBuilder.java" checks="com.azure.tools.checkstyle.checks.ServiceClientBuilderCheck" />
8+
</suppressions>

sdk/clientcore/http-netty/pom.xml

Lines changed: 200 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,200 @@
1+
<!--
2+
~ Copyright (c) Microsoft Corporation. All rights reserved.
3+
~ Licensed under the MIT License.
4+
-->
5+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
6+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
7+
<modelVersion>4.0.0</modelVersion>
8+
<parent>
9+
<groupId>io.clientcore</groupId>
10+
<artifactId>clientcore-parent</artifactId>
11+
<version>1.0.0-beta.3</version> <!-- {x-version-update;io.clientcore:clientcore-parent;current} -->
12+
<relativePath>../../parents/clientcore-parent</relativePath>
13+
</parent>
14+
15+
<groupId>io.clientcore</groupId>
16+
<artifactId>http-netty</artifactId>
17+
<packaging>jar</packaging>
18+
<version>1.0.0-beta.1</version> <!-- {x-version-update;io.clientcore:http-netty;current} -->
19+
20+
<name>Java Netty HTTP Client Library</name>
21+
<description>This package contains the Netty HTTP client plugin for io.clientcore.</description>
22+
<url>https://github.com/Azure/azure-sdk-for-java</url>
23+
24+
<licenses>
25+
<license>
26+
<name>The MIT License (MIT)</name>
27+
<url>http://opensource.org/licenses/MIT</url>
28+
<distribution>repo</distribution>
29+
</license>
30+
</licenses>
31+
32+
<scm>
33+
<url>https://github.com/Azure/azure-sdk-for-java</url>
34+
<connection>scm:git:https://github.com/Azure/azure-sdk-for-java.git</connection>
35+
<developerConnection>scm:git:https://github.com/Azure/azure-sdk-for-java.git</developerConnection>
36+
</scm>
37+
38+
<properties>
39+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
40+
<legal><![CDATA[[INFO] Any downloads listed may be third party software. Microsoft grants you no rights for third party software.]]></legal>
41+
<jacoco.min.linecoverage>0.80</jacoco.min.linecoverage>
42+
<jacoco.min.branchcoverage>0.65</jacoco.min.branchcoverage>
43+
<javaModulesSurefireArgLine>
44+
--add-exports io.clientcore.core/io.clientcore.core.implementation.http=ALL-UNNAMED
45+
--add-exports io.clientcore.core/io.clientcore.core.implementation.http.serializer=ALL-UNNAMED
46+
--add-exports io.clientcore.core/io.clientcore.core.implementation.util=ALL-UNNAMED
47+
48+
--add-opens io.clientcore.http.netty/io.clientcore.http.netty=ALL-UNNAMED
49+
--add-opens io.clientcore.http.netty/io.clientcore.http.netty.implementation=ALL-UNNAMED
50+
</javaModulesSurefireArgLine>
51+
52+
<!-- Enables fail on deprecated API usage. -->
53+
<compiler.failondeprecatedstatus/>
54+
55+
<javadoc.excludePackageNames>
56+
io.clientcore.core.annotation,io.clientcore.core.credential,io.clientcore.core.http,io.clientcore.core.http.annotation,io.clientcore.core.http.client,
57+
io.clientcore.core.http.exception,io.clientcore.core.http.models,io.clientcore.core.http.pipeline,io.clientcore.core.implementation,
58+
io.clientcore.core.implementation*,io.clientcore.core.models,io.clientcore.core.util,io.clientcore.core.util*
59+
</javadoc.excludePackageNames>
60+
</properties>
61+
62+
<dependencies>
63+
<dependency>
64+
<groupId>io.clientcore</groupId>
65+
<artifactId>core</artifactId>
66+
<version>1.0.0-beta.8</version> <!-- {x-version-update;io.clientcore:core;current} -->
67+
</dependency>
68+
69+
<dependency>
70+
<groupId>io.netty</groupId>
71+
<artifactId>netty-buffer</artifactId>
72+
<version>4.1.118.Final</version> <!-- {x-version-update;io.netty:netty-buffer;external_dependency} -->
73+
</dependency>
74+
<dependency>
75+
<groupId>io.netty</groupId>
76+
<artifactId>netty-codec</artifactId>
77+
<version>4.1.118.Final</version> <!-- {x-version-update;io.netty:netty-codec;external_dependency} -->
78+
</dependency>
79+
<dependency>
80+
<groupId>io.netty</groupId>
81+
<artifactId>netty-codec-http</artifactId>
82+
<version>4.1.118.Final</version> <!-- {x-version-update;io.netty:netty-codec-http;external_dependency} -->
83+
</dependency>
84+
<dependency>
85+
<groupId>io.netty</groupId>
86+
<artifactId>netty-codec-http2</artifactId>
87+
<version>4.1.118.Final</version> <!-- {x-version-update;io.netty:netty-codec-http2;external_dependency} -->
88+
</dependency>
89+
<dependency>
90+
<groupId>io.netty</groupId>
91+
<artifactId>netty-common</artifactId>
92+
<version>4.1.118.Final</version> <!-- {x-version-update;io.netty:netty-common;external_dependency} -->
93+
</dependency>
94+
<dependency>
95+
<groupId>io.netty</groupId>
96+
<artifactId>netty-handler</artifactId>
97+
<version>4.1.118.Final</version> <!-- {x-version-update;io.netty:netty-handler;external_dependency} -->
98+
</dependency>
99+
<dependency>
100+
<groupId>io.netty</groupId>
101+
<artifactId>netty-handler-proxy</artifactId>
102+
<version>4.1.118.Final</version> <!-- {x-version-update;io.netty:netty-handler-proxy;external_dependency} -->
103+
</dependency>
104+
<dependency>
105+
<groupId>io.netty</groupId>
106+
<artifactId>netty-resolver</artifactId>
107+
<version>4.1.118.Final</version> <!-- {x-version-update;io.netty:netty-resolver;external_dependency} -->
108+
</dependency>
109+
<dependency>
110+
<groupId>io.netty</groupId>
111+
<artifactId>netty-resolver-dns</artifactId>
112+
<version>4.1.118.Final</version> <!-- {x-version-update;io.netty:netty-resolver-dns;external_dependency} -->
113+
</dependency>
114+
<dependency>
115+
<groupId>io.netty</groupId>
116+
<artifactId>netty-transport</artifactId>
117+
<version>4.1.118.Final</version> <!-- {x-version-update;io.netty:netty-transport;external_dependency} -->
118+
</dependency>
119+
120+
<!-- Test dependencies on core, because we want to run tests inherited from this module using Netty -->
121+
<dependency>
122+
<groupId>io.clientcore</groupId>
123+
<artifactId>core</artifactId>
124+
<version>1.0.0-beta.8</version> <!-- {x-version-update;io.clientcore:core;current} -->
125+
<type>test-jar</type>
126+
<scope>test</scope>
127+
</dependency>
128+
<dependency>
129+
<groupId>org.eclipse.jetty</groupId>
130+
<artifactId>jetty-server</artifactId>
131+
<version>9.4.56.v20240826</version> <!-- {x-version-update;org.eclipse.jetty:jetty-server;external_dependency} -->
132+
<scope>test</scope>
133+
</dependency>
134+
<dependency>
135+
<groupId>org.eclipse.jetty</groupId>
136+
<artifactId>jetty-servlet</artifactId>
137+
<version>9.4.56.v20240826</version> <!-- {x-version-update;org.eclipse.jetty:jetty-servlet;external_dependency} -->
138+
<scope>test</scope>
139+
</dependency>
140+
<dependency>
141+
<groupId>org.junit.jupiter</groupId>
142+
<artifactId>junit-jupiter-api</artifactId>
143+
<version>5.11.2</version> <!-- {x-version-update;org.junit.jupiter:junit-jupiter-api;external_dependency} -->
144+
<scope>test</scope>
145+
</dependency>
146+
<dependency>
147+
<groupId>org.junit.jupiter</groupId>
148+
<artifactId>junit-jupiter-engine</artifactId>
149+
<version>5.11.2</version> <!-- {x-version-update;org.junit.jupiter:junit-jupiter-engine;external_dependency} -->
150+
<scope>test</scope>
151+
</dependency>
152+
153+
<dependency>
154+
<groupId>org.junit.jupiter</groupId>
155+
<artifactId>junit-jupiter-params</artifactId>
156+
<version>5.11.2</version> <!-- {x-version-update;org.junit.jupiter:junit-jupiter-params;external_dependency} -->
157+
<scope>test</scope>
158+
</dependency>
159+
<dependency>
160+
<groupId>org.mockito</groupId>
161+
<artifactId>mockito-core</artifactId>
162+
<version>4.11.0</version><!-- {x-version-update;org.mockito:mockito-core;external_dependency} -->
163+
<scope>test</scope>
164+
</dependency>
165+
<dependency>
166+
<groupId>org.conscrypt</groupId>
167+
<artifactId>conscrypt-openjdk-uber</artifactId>
168+
<version>2.5.2</version> <!-- {x-version-update;org.conscrypt:conscrypt-openjdk-uber;external_dependency} -->
169+
<scope>test</scope>
170+
</dependency>
171+
</dependencies>
172+
173+
<build>
174+
<plugins>
175+
<plugin>
176+
<groupId>org.apache.maven.plugins</groupId>
177+
<artifactId>maven-enforcer-plugin</artifactId>
178+
<version>3.5.0</version> <!-- {x-version-update;org.apache.maven.plugins:maven-enforcer-plugin;external_dependency} -->
179+
<configuration>
180+
<rules>
181+
<bannedDependencies>
182+
<includes>
183+
<include>io.netty:netty-buffer:[4.1.118.Final]</include> <!-- {x-include-update;io.netty:netty-buffer;external_dependency} -->
184+
<include>io.netty:netty-codec:[4.1.118.Final]</include> <!-- {x-include-update;io.netty:netty-codec;external_dependency} -->
185+
<include>io.netty:netty-codec-http:[4.1.118.Final]</include> <!-- {x-include-update;io.netty:netty-codec-http;external_dependency} -->
186+
<include>io.netty:netty-codec-http2:[4.1.118.Final]</include> <!-- {x-include-update;io.netty:netty-codec-http2;external_dependency} -->
187+
<include>io.netty:netty-common:[4.1.118.Final]</include> <!-- {x-include-update;io.netty:netty-common;external_dependency} -->
188+
<include>io.netty:netty-handler:[4.1.118.Final]</include> <!-- {x-include-update;io.netty:netty-handler;external_dependency} -->
189+
<include>io.netty:netty-handler-proxy:[4.1.118.Final]</include> <!-- {x-include-update;io.netty:netty-handler-proxy;external_dependency} -->
190+
<include>io.netty:netty-resolver:[4.1.118.Final]</include> <!-- {x-include-update;io.netty:netty-resolver;external_dependency} -->
191+
<include>io.netty:netty-resolver-dns:[4.1.118.Final]</include> <!-- {x-include-update;io.netty:netty-resolver-dns;external_dependency} -->
192+
<include>io.netty:netty-transport:[4.1.118.Final]</include> <!-- {x-include-update;io.netty:netty-transport;external_dependency} -->
193+
</includes>
194+
</bannedDependencies>
195+
</rules>
196+
</configuration>
197+
</plugin>
198+
</plugins>
199+
</build>
200+
</project>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
3+
<FindBugsFilter xmlns="https://github.com/spotbugs/filter/3.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="https://github.com/spotbugs/filter/3.0.0 https://raw.githubusercontent.com/spotbugs/spotbugs/3.1.0/spotbugs/etc/findbugsfilter.xsd">
5+
<Match>
6+
<Bug pattern="BC_UNCONFIRMED_CAST_OF_RETURN_VALUE" />
7+
<Class name="io.clientcore.http.netty.NettyHttpClient" />
8+
</Match>
9+
<Match>
10+
<Bug pattern="SIC_INNER_SHOULD_BE_STATIC_ANON" />
11+
<Class name="io.clientcore.http.netty.NettyHttpClient" />
12+
</Match>
13+
<Match>
14+
<Bug pattern="URF_UNREAD_FIELD" />
15+
<Class name="io.clientcore.http.netty.NettyHttpClientBuilder" />
16+
</Match>
17+
<Match>
18+
<Bug pattern="UWF_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR" />
19+
<Class name="io.clientcore.http.netty.NettyHttpClientBuilder" />
20+
</Match>
21+
</FindBugsFilter>

0 commit comments

Comments
 (0)