[Java SDK] Add batch send/receive operations for better throughput
- 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
Assessment
This issue has not been assessed yet.