zjncs opened a new pull request, #5610:
URL: https://github.com/apache/rocketmq-dashboard/pull/5610
Closes #5609
## Problem
The consumer-group create form posts `deliveryOrderType` = `PARTITON_ORDER`
/ `MESSAGES_ORDER` (order-type select under a FIFO subscription) and the CSV
import accepts `PARTITION_ORDER`; `CreateConsumerGroupDTO` passes the string
through. But `normalizeDeliveryOrderType` — whose javadoc promises to "tolerate
FIFO/ordered spellings from the UI" — only recognized the literal
`FIFO`/`ORDERLY` spellings, so **every UI selection fell through to
`Concurrently`**, and `createConsumerGroup` then picked `DefaultRetryPolicy`
instead of the fixed-interval policy ordered groups require.
On Aliyun instances, every ordered-group creation from the console silently
produced a Concurrently group — the operator's order-type selection was
discarded. (Tencent is unaffected: `isOrderly` matches `*ORDER*`. Apache treats
the field as metadata only.)
## Fix
Recognize any `ORDER` spelling (matching the Tencent provider's convention)
plus `FIFO`:
```java
String upper = raw.trim().toUpperCase(Locale.ROOT);
if ("FIFO".equals(upper) || upper.contains("ORDER")) {
return ORDERLY_DELIVERY_ORDER_TYPE;
}
```
Backend-only by design: fixing the `PARTITON` typo in the form instead would
collide with the consumer-page i18n PR #5529 and leave the CSV import path
broken; the normalizer is where the javadoc already promises UI-spelling
tolerance.
## Verification
- New contract test `AliyunDeliveryOrderTypeContractTest`: **FAILS on
master** (`expected: <Orderly> but was: <Concurrently>` for `PARTITON_ORDER`,
`MESSAGES_ORDER`, `PARTITION_ORDER`), **PASSES with this change**
- Regression: full `AliyunInstanceProviderTest` 35/35 (including the
existing `normalizeDeliveryOrderTypeShouldMapFifoToOrderlyTest` sibling)
- Mutation check: reverting the normalizer makes the contract test fail
again; restoring it passes
## Collision note
`AliyunInstanceProvider.java` is touched by #4504/#4514 (both read-path
hunks: 54, 129-201, 296-339, 423-627); this change is confined to
`normalizeDeliveryOrderType` at ~378-393 — the nearest hunk ends at 339, a
39-line buffer. The new test class is untouched by any PR (the existing
`AliyunInstanceProviderTest` is heavily edited by #4504, hence the separate
class).
--
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]