Skip to content

Conversation

@rythm-sachdeva
Copy link

@rythm-sachdeva rythm-sachdeva commented Jan 16, 2026

Description

This PR implements connection pooling for the AsyncTcpConnection in the Java SDK, resolving issue #2232.

Previously, the async client used a single connection, which could lead to bottlenecks. This implementation introduces a configurable pool (using Netty's FixedChannelPool) to improve throughput and reliability.

Key Changes

  • Integrated Netty's FixedChannelPool into AsyncTcpConnection.
  • Added TCPConnectionPoolConfig to allow configuration of:
    • Max connections
    • Max pending acquires
    • Acquire timeout
  • Implemented PoolMetrics to track:
    • Active/Idle connections
    • Wait times and errors
  • Updated sendAsync to acquire channels from the pool and release them back upon completion (or failure).
  • Added logic to handle CompletableFuture cancellation and channel health checks.

Issue Link

Closes #2232

Checklist

  • My code follows the code style of this project (Checkstyle passed).
  • I have added tests to cover my changes. (Optional: Check if you added tests)

@mmodzelewski
Copy link
Member

Hey @rythm-sachdeva, please fix the CI issues and ping me once the PR is ready for review.

@rythm-sachdeva
Copy link
Author

Sure @mmodzelewski

@rythm-sachdeva rythm-sachdeva changed the title feat(java-sdk): implement connection pooling for AsyncTcpConnection (… feat(java): implement connection pooling for AsyncTcpConnection (… Jan 21, 2026
@rythm-sachdeva
Copy link
Author

Hi @mmodzelewski Can You review it now

@hubcio
Copy link
Contributor

hubcio commented Jan 21, 2026

@rythm-sachdeva lints are not passing and PR is not rebased. we will not check it until CI is green.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Java SDK] Implement Connection Pooling for Async Client

3 participants