zjncs opened a new pull request, #5534:
URL: https://github.com/apache/rocketmq-dashboard/pull/5534
## Problem
`normalizeDeliveryOrderType` (`AliyunInstanceProvider.java:381`) matched
only the **exact** strings `FIFO`/`ORDERLY`:
```java
if ("FIFO".equalsIgnoreCase(value) || "ORDERLY".equalsIgnoreCase(value)) {
return ORDERLY_DELIVERY_ORDER_TYPE;
}
return DEFAULT_DELIVERY_ORDER_TYPE; // Concurrently
```
But the consumer-group **create dialog emits `PARTITON_ORDER` /
`MESSAGES_ORDER`** (`consumer.tsx:2441-2452`, the 顺序类型 select — not guarded by
`isCloudInstance`, the create button is enabled for Aliyun instances), and both
values are pinned by `docs/api-spec.md:947`. The CSV-import util even accepts
both `PARTITON_ORDER` and `PARTITION_ORDER` spellings.
Result (Java repro, ran): **every dialog ordering choice mapped to
`Concurrently`** — an operator choosing FIFO + 分区顺序/全局顺序 gets a **concurrent**
group provisioned on the cloud, silently, with no error. The same file's
Tencent counterpart (`isOrderly`, `contains("FIFO") || contains("ORDER")`)
already handles the dialog values correctly — the Aliyun mapping is the outlier.
## Fix
Make the mapping order-tolerant, mirroring Tencent's `isOrderly`: any value
containing `FIFO` or `ORDER` (case-insensitive) → `Orderly`; everything else
stays `Concurrently`. Exact `FIFO`/`Orderly` spellings keep working.
The Apache provider's create path does **not** persist the ordering field at
all (`RmqGroup` has no column, no read path sets it) — that data-loss gap is
real but needs a schema decision, so it's noted here rather than changed.
## Verification
New JUnit case `createConsumerGroupShouldKeepDialogOrderingChoicesTest`
(reuses the existing `createConsumerGroup` mock conventions):
- **before**: `PARTITON_ORDER → Concurrently`, `MESSAGES_ORDER →
Concurrently` (repro'd; the test fails on the first choice with `expected:
Orderly but was: Concurrently`);
- **after**: all four choices (`PARTITON_ORDER`, `MESSAGES_ORDER`, `FIFO`,
`Orderly`) send `Orderly` — **36/36** in `AliyunInstanceProviderTest`;
- **mutation** (revert the provider): back to 1 failed; restore: 36/36.
```bash
cd server && mvn test -Dtest=AliyunInstanceProviderTest
```
--
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]