unbridled-41 commented on PR #11050:
URL: https://github.com/apache/rocketmq/pull/11050#issuecomment-5970066494
Both points are addressed in 4594417b5.
**The fallback builds per-message results.** The unsplittable-id branch no
longer reuses the batch result: it creates one result per request message from
the id the request already carries plus the batch's first offset, while status,
message queue, transaction id, offsetMsgId and region stay shared with the
batch:
```java
String messageId =
request.getMessages(i).getSystemProperties().getMessageId();
SendResult expanded = new SendResult(batchResult.getSendStatus(),
StringUtils.isNotBlank(messageId) ? messageId : batchResult.getMsgId(),
batchResult.getMessageQueue(), batchResult.getQueueOffset() + i,
batchResult.getTransactionId(), batchResult.getOffsetMsgId(),
batchResult.getRegionId());
expanded.setRecallHandle(batchResult.getRecallHandle());
```
**Regression test for the local-mode shape.**
`testConvertToSendMessageResponseExpandsLocalBatchWithRequestMessageIds` sends
three request messages through a batch result carrying a single uniq id (what
local mode returns) and pins each entry's own `messageId` and `queueOffset +
i`. Before the change it fails exactly the way you described:
```
each entry must keep the request message's own id
expected:<...018B4AAC20F1B101B000[1]> but was:<...018B4AAC20F1B101B000[0]>
```
After: `mvn -pl proxy -Dtest=SendMessageActivityTest test` → `Tests run: 14,
Failures: 0, Errors: 0, Skipped: 0`. The comma-splittable branch is untouched
and still covered by the existing test.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]