The GitHub Actions job "Java Coverage" on 
rocketmq-clients.git/batch-simple-consumer-0 has succeeded.
Run started by GitHub user qianye1001 (triggered by qianye1001).

Head commit for run:
17ab2130da076d2dcc110916e08493944bc23340 / qianye 
<[email protected]>
feat(java): add batch receive and batch consume support for SimpleConsumer and 
PushConsumer

## SimpleConsumer — adaptive batch receive

- Add BatchingSimpleConsumerImpl: a SimpleConsumer decorator that converts 
batchReceive() into adaptive concurrent receiveAsync() calls with no background 
thread, no local cache.

- Adaptive algorithm: remaining messages are evenly distributed across 
min(ceil(remaining/32), maxInflight) concurrent receives per round. Deadline 
starts from the first message received; inflight requests always run to 
completion (never cancelled).

- Add batchReceive(String topic, Duration) and batchReceiveAsync(String topic, 
Duration) to SimpleConsumer interface for topic-specific batch polling.

- Add batchAck/batchAckAsync to SimpleConsumer: messages are grouped by (topic, 
endpoints) and split into bounded chunks for efficient batch RPC.

## PushConsumer — batch consume service

- Add BatchConsumeService: accumulates messages from all ProcessQueues into a 
single BatchBuffer, flushing to BatchMessageListener when maxBatchCount, 
maxBatchBytes, or maxWaitTime is reached.

- Add BatchBuffer: encapsulated accumulation buffer with lock-based 
concurrency, timeout-based flush scheduling, and forward-progress guarantee (at 
least one message per takeBatch).

- Add BatchConsumeTask: Callable that invokes BatchMessageListener with 
interceptor hooks.

- Add BatchMessageListener interface and 
PushConsumerBuilder.setBatchPolicy/setBatchMessageListener.

## BatchPolicy

- Shared policy for both consumer models with maxBatchCount, maxBatchBytes, 
maxWaitTime, maxInflight.

- Builder pattern with sensible defaults (32 msgs, 4MB, 5s, 4 inflight).

## Tests

- BatchingSimpleConsumerImplTest: 16 tests covering count/bytes/timeout 
triggers, adaptive multi-round, maxInflight cap, topic-specific, 
inflight-always-complete, error handling, delegation, concurrency, close.

- BatchConsumeServiceTest: 10 tests covering single/multi-batch flush, timeout 
flush, close flush, corrupted message discard, interleaved ProcessQueues, batch 
consumption callback.

- BatchConsumeTaskTest: 4 tests covering success/failure/exception/null-return 
scenarios.

- ConsumerImplTest: tests for batchAck grouping and chunking logic.

Report URL: https://github.com/apache/rocketmq-clients/actions/runs/24763318351

With regards,
GitHub Actions via GitBox

Reply via email to