Skip to content

Commit 92b9bc0

Browse files
Bump org.asynchttpclient:async-http-client from 2.12.3 to 3.0.0 (#466)
* Bump org.asynchttpclient:async-http-client from 2.12.3 to 3.0.0 Bumps [org.asynchttpclient:async-http-client](https://github.com/AsyncHttpClient/async-http-client) from 2.12.3 to 3.0.0. - [Release notes](https://github.com/AsyncHttpClient/async-http-client/releases) - [Changelog](https://github.com/AsyncHttpClient/async-http-client/blob/main/CHANGES.md) - [Commits](AsyncHttpClient/async-http-client@async-http-client-project-2.12.3...async-http-client-project-3.0.0) --- updated-dependencies: - dependency-name: org.asynchttpclient:async-http-client dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> * fixup for update --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Brandon Arp <[email protected]>
1 parent 262f06f commit 92b9bc0

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575
<apache.httpcore.version>4.4.16</apache.httpcore.version>
7676
<arpnetworking.commons.version>3.1.1</arpnetworking.commons.version>
7777
<aspectjrt.version>1.9.22.1</aspectjrt.version>
78-
<asynchttpclient.version>2.12.3</asynchttpclient.version>
78+
<asynchttpclient.version>3.0.0</asynchttpclient.version>
7979
<bouncy.castle.version>1.78.1</bouncy.castle.version>
8080
<client.protocol.version>0.12.0</client.protocol.version>
8181
<fastutil.version>8.5.14</fastutil.version>

src/main/java/com/arpnetworking/tsdcore/sinks/HttpPostSink.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ protected void start(final Builder<?, ?> builder) {
203203
static {
204204
final DefaultAsyncHttpClientConfig.Builder clientConfigBuilder = new DefaultAsyncHttpClientConfig.Builder();
205205
clientConfigBuilder.setThreadPoolName("HttpPostSinkWorker")
206-
.setConnectionTtl(300000);
206+
.setConnectionTtl(Duration.ofSeconds(300));
207207
final AsyncHttpClientConfig clientConfig = clientConfigBuilder.build();
208208
CLIENT = new DefaultAsyncHttpClient(clientConfig);
209209
}

src/main/java/com/arpnetworking/tsdcore/sinks/HttpPostSinkActor.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -231,13 +231,15 @@ private void processRejectedRequest(final PostRejected rejected) {
231231
_inflightRequestsCount--;
232232
final Response response = rejected.getResponse();
233233
final Optional<String> responseBody = Optional.ofNullable(response.getResponseBody());
234+
final byte[] requestBodyBytes = rejected.getRequest().getByteData();
235+
// CHECKSTYLE.OFF: IllegalInstantiation - This is ok for String from byte[]
236+
final String requestBody = requestBodyBytes == null ? null : new String(requestBodyBytes, Charsets.UTF_8);
237+
// CHECKSTYLE.ON: IllegalInstantiation
234238
LOGGER.warn()
235239
.setMessage("Post rejected")
236240
.addData("sink", _sink)
237241
.addData("status", response.getStatusCode())
238-
// CHECKSTYLE.OFF: IllegalInstantiation - This is ok for String from byte[]
239-
.addData("request", new String(rejected.getRequest().getByteData(), Charsets.UTF_8))
240-
// CHECKSTYLE.ON: IllegalInstantiation
242+
.addData("request", requestBody)
241243
.addData("response", responseBody)
242244
.addContext("actor", self())
243245
.log();

0 commit comments

Comments
 (0)