apache / apache/iggy

[Java SDK] Add batch send/receive operations for better throughput

Open
#2,203 0 comments 0 reactions 1 assignee Claimed by @mmodzelewski View on GitHub
enhancement java
Dominant language
Rust
Stars
4.9k
Forks
432
Avg merge
2d 10h
Merged PRs (30d)
173

Description

**Title:** `[Java SDK] Add batch send/receive operations for better throughput`

**Description:**
Currently, messages must be sent one at a time, significantly impacting throughput. Batch operations are essential for high-performance scenarios.

**Current State:**
```java
// Must send messages individually
for (Message message : messages) {
client.messages().sendMessages(streamId, topicId,
Partitioning.balanced(), Collections.singletonList(message));
}
```

**Proposed Solution:**
```java
// Batch send
BatchResult result = client.messages().sendBatch(streamId, topicId, messages);

// Configurable batching
client.messages().sendMessagesWithBatching(
streamId, topicId, messages,
BatchConfig.builder()
.maxBatchSize(1000)
.maxLatency(Duration.ofMillis(100))
.build()
);
```

**Expected Impact:**
- 5-10x throughput improvement (always measure)
- Reduced network overhead
- Better resource utilization

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.