AsyncHttpClient/async-http-client hiện có 6.4k sao trên GitHub, viết chủ yếu bằng Java. Asynchronous, non-blocking HTTP & WebSocket client for the JVM
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
AsyncHttpClient (AHC) is a high-performance, asynchronous HTTP client for Java
built on top of Netty.
It supports HTTP/1.1, HTTP/2, and WebSocket protocols.
Table of Contents
Features
Requirements
Installation
Quick Start
Configuration
HTTP Requests
Handling Responses
HTTP/2
WebSocket
Authentication
Proxy Support
Community
License
Features
HTTP/2 with multiplexing — enabled by default over TLS via ALPN,
with connection multiplexing and GOAWAY handling
HTTP/1.1 and HTTP/1.0 — connection pooling and keep-alive
WebSocket — text, binary, and ping/pong frame support
Asynchronous API — non-blocking I/O with ListenableFuture
and CompletableFuture
Compression — automatic gzip, deflate, Brotli, and Zstd decompression
Authentication — Basic, Digest, NTLM, SPNEGO/Kerberos, and SCRAM-SHA-256
Proxy — HTTP, SOCKS4, and SOCKS5 with CONNECT tunneling
Native transports — optional Epoll, KQueue, and io_uring
Request/response filters — intercept and transform at each stage
Cookie management — RFC 6265-compliant cookie store
Multipart uploads — file, byte array, input stream, and string parts
AHC decompresses Brotli, Zstd and Snappy response bodies on demand with Netty's pull-based Decompressor API, which
exists since Netty 4.2.17. If you override AHC's Netty version with an older one, these codings are still
decompressed, but as soon as they are read, so a suspended response does not hold them back. The same applies to Zstd
if the system property io.netty.compression.defaultMaxForwardBytes is set to zero or a negative value. gzip and
deflate are not affected.
Over HTTP/1.1, a compressed response body that ends in the middle of its compressed stream, for example because a
body delimited by the connection was cut off, fails the request with a DecompressionException; a body without any
bytes completes. Not every such end is noticed. A gzip or Zstd body cut exactly between two of its members or frames
looks complete, as the stream may end after any of them, and Snappy has no end marker, so a body cut between two of its
chunks looks complete too. With zstd-jni older than 1.5.7-26, a Zstd body of several frames also completes when it is
cut inside a frame that started in the same chunk as the end of the previous one. zstd-jni is an optional dependency, so
the version your application declares is the one used: use 1.5.7-26 or later. HTTP/2 response bodies are not checked,
and neither are transfer codings such as Transfer-Encoding: gzip, nor Brotli, Zstd and Snappy bodies decompressed as
soon as they are read, as described above.
Quick Start
Import the DSL helpers:
import static org.asynchttpclient.Dsl.*;
Create a client, execute a request, and read the response:
Note:AsyncHttpClient instances are long-lived, shared resources.
Always close them when done. Creating a new client per request will degrade
performance due to repeated thread pool and connection pool creation.
For fine-grained control, implement AsyncHandler directly. This lets you
inspect status, headers, and body chunks as they arrive and abort early:
Future<Integer> future = client
.prepareGet("https://www.example.com/")
.execute(new AsyncHandler<>() {
private int status;
@Override
public State onStatusReceived(HttpResponseStatus s) {
status = s.getStatusCode();
return State.CONTINUE;
}
@Override
public State onHeadersReceived(HttpHeaders headers) {
return State.CONTINUE;
}
@Override
public State onBodyPartReceived(HttpResponseBodyPart part) {
return State.ABORT; // stop early — we only needed the status
}
@Override
public Integer onCompleted() {
return status;
}
@Override
public void onThrowable(Throwable t) {
t.printStackTrace();
}
});
HTTP/2
HTTP/2 is enabled by default for HTTPS connections via ALPN negotiation.
The client uses HTTP/2 when the server supports it and falls back to HTTP/1.1
otherwise. No additional configuration is required.
Connection multiplexing — concurrent streams over a single TCP connection
GOAWAY handling — graceful connection draining on server shutdown
PING keepalive — configurable ping frames to keep connections alive
When a handler suspends a response with ResponseBodyControl, the HTTP/2
per-stream window remains the buffering bound for that response. While at least
one response on a connection is suspended, AHC continues returning
connection-level credit so it cannot stall sibling streams. Connections with no
active suspension retain the normal 65,535-byte shared connection-window bound.
Once the last suspension ends, normal connection accounting resumes, although
credit already returned and data already queued cannot be revoked. Aggregate
queued response data during suspension can scale with the number of concurrent
streams. Use http2InitialWindowSize and http2MaxConcurrentStreams together
when an application needs a tighter aggregate bound.
AsyncHttpClient/async-http-client có bao nhiêu sao?
AsyncHttpClient/async-http-client có 6.4k sao GitHub — tải lại trang để xem số mới nhất, hoặc xem trực tiếp github.com/AsyncHttpClient/async-http-client. TopGit phản chiếu số sao của GitHub nhưng không cam kết đến từng phút.
AsyncHttpClient/async-http-client có những chủ đề gì?
GitHub topics của AsyncHttpClient/async-http-client: "ahc", "async", "asynchttpclient", "http-client", "java", "netty". TopGit xếp repo vào nhóm Backend.
AsyncHttpClient/async-http-client còn đang phát triển không?
Commit gần nhất trên AsyncHttpClient/async-http-client là 3 tháng trước (theo timestamp GitHub). Repo có 1.6k fork — một chỉ báo về mức độ quan tâm của cộng đồng.
AsyncHttpClient/async-http-client viết bằng ngôn ngữ gì?
AsyncHttpClient/async-http-client chủ yếu viết bằng Java. Trường "language" của GitHub dựa trên phần lớn byte ở nhánh mặc định.
Cùng nhóm Backend còn repo nào?
AsyncHttpClient/async-http-client thuộc nhóm Backend trên TopGit, cùng 6 topic GitHub. Trang Trending và Topics liệt kê các repo cùng số sao và cùng ngôn ngữ để so sánh.
Đọc thêm về AsyncHttpClient/async-http-client ở đâu?
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/AsyncHttpClient/async-http-client là nguồn chính thức.
Vì sao AsyncHttpClient/async-http-client được xếp vào nhóm Backend?
TopGit xếp AsyncHttpClient/async-http-client vào nhóm Backend dựa trên GitHub topics và mô tả của repo (gắn thẻ: "ahc", "async", "asynchttpclient"). Việc phân loại dựa trên metadata thật của repo, không phải đoán theo cảm tính biên tập.
Đọc đầy đủ README ở tab phía trên.
Chưa chắc async-http-client có hợp với bạn?
Để ChatGPT, Claude hoặc Perplexity tìm hiểu giúp — bấm bên dưới và xem AI nói gì về async-http-client.