Wang1rrr opened a new pull request, #4839:
URL: https://github.com/apache/rocketmq-dashboard/pull/4839

   <!-- Make sure the base branch is `master`: that is the RocketMQ Studio 
trunk. -->
   
   ### Which Issue(s) This PR Fixes
   
   - Fixes #4838
   
   ### Brief Description
   
   The console's create-consumer-group form submits a delivery order type, both 
cloud providers act on it, and the Apache provider - the path every 
self-managed cluster takes - drops it on the floor.
   
   `web/src/pages/instance/consumer.tsx:2441` renders 顺序类型 with 
`initialValue="PARTITON_ORDER"` (分区顺序) alongside `MESSAGES_ORDER` (全局顺序) 
whenever 订阅组类型 is FIFO, and `:2348` puts `values.deliveryOrderType` in the 
create payload. `CreateConsumerGroupDTO` copies it onto `ConsumerGroupVO` 
(`:34`, `:50`), and from there:
   
   | provider | what happens to `deliveryOrderType` |
   | --- | --- |
   | Aliyun | `normalizeDeliveryOrderType` maps the ordered spellings to 
`Orderly` (`AliyunInstanceProvider.java:381`) |
   | Tencent | `isOrderly(group)` drives 
`request.setConsumeMessageOrderly(...)` (`TencentInstanceProvider.java:1056`, 
`:503`) |
   | **Apache** | **never read** - `createConsumerGroup` sets only `groupName`, 
`consumeEnable`, `consumeBroadcastEnable`, `retryQueueNums`, `retryMaxTimes` 
(`RocketMQAdminClientImpl.java:738`) |
   
   `consumeMessageOrderly` therefore keeps its `false` default, 
`persistConsumerGroup` has nowhere to record the choice either (`RmqGroup` has 
no such column), and the controller echoes the submitted VO straight back - so 
the browser is told the ordered group it asked for was created, while the 
broker holds an unordered one. The `CREATE_GROUP` audit record only mentioned 
`retryMaxTimes`, so there was no trace of the dropped value.
   
   This is not a concept Studio lacks: the very same flag is already an 
editable group setting, read at `RocketMQAdminClientImpl.java:648` into 
`ConsumerGroupSettingsVO` and written back at `:689` from 
`ConsumerGroupSettingsCommand`. Two UI surfaces for one intent, and the create 
surface was wired to neither - an operator who picked 分区顺序 had to notice 
afterwards and flip it in the settings dialog.
   
   **The change** derives the flag in the create path and records it in the 
audit detail:
   
   ```java
   boolean consumeMessageOrderly = 
isOrderlyDelivery(group.getDeliveryOrderType());
   config.setConsumeMessageOrderly(consumeMessageOrderly);
   ```
   
   `isOrderlyDelivery` uses the vocabulary `TencentInstanceProvider.isOrderly` 
already accepts - a case-insensitive `FIFO` or `ORDER` substring - so 
`PARTITON_ORDER` (the console's own spelling), `PARTITION_ORDER` (also allowed 
by the CSV importer), `MESSAGES_ORDER`, `FIFO` and `ORDERLY` all mean ordered, 
while `Concurrently`, blank and absent stay unordered. Ordered now means the 
same thing on all three backends, and the AI tool path (`GroupInput.java:38`) 
and the CSV importer (`resourceCsvImport.ts:376`) are fixed by the same change 
because they go through this method.
   
   Deliberately out of scope: `subscriptionDataType` is dropped by the same 
create path for the same reason, but recording it needs a new `RmqGroup` 
column, which is a schema change and a separate discussion.
   
   ### How Did You Test This Change?
   
   ```
   cd server
   mvn -o -B -ntp test -Dtest=RocketMQAdminClientImplTest
    Tests run: 80, Failures: 0, Errors: 0, Skipped: 0
    BUILD SUCCESS
   
   mvn -o -B -ntp test
    Tests run: 3155, Failures: 7, Errors: 26, Skipped: 4
   ```
   
   Checkstyle runs in the `validate` phase of this build (`failsOnError=true`, 
`includeTestSourceDirectory=true`), so both runs also prove the new code and 
test pass `style/rmq_checkstyle.xml`.
   
   Every remaining failure in the full run is environmental and pre-existing on 
this Windows box, none in a group-related class:
   
   - 26 errors are `Failed to load ApplicationContext` in the 
`*IntegrationTest` classes (`StudioApplicationTest`, 
`HealthProbeIntegrationTest`, `AuthService*IntegrationTest`, 
`QueryHistoryServiceIntegrationTest`, `NativeAlertEvaluationTransactionTest`, 
`NotificationOutboxMapperIntegrationTest`, 
`RmqAlertStateMapperIntegrationTest`) - CONTRIBUTING.md notes the integration 
tests need MySQL 8;
   - 7 failures are `CliAgentProviderTest` (3) and 
`ClaudeCodeAgentProviderTest` (4) reporting `sh CLI is not installed in the 
server runtime` / `Failed to execute sh CLI`, i.e. no POSIX shell on PATH here.
   
   Two new parameterized tests in `RocketMQAdminClientImplTest` capture the 
`SubscriptionGroupConfig` handed to `createAndUpdateSubscriptionGroupConfig`:
   
   - `createConsumerGroupPropagatesAnOrderedDeliveryOrderTypeToTheBroker` - 
`PARTITON_ORDER`, `PARTITION_ORDER`, `MESSAGES_ORDER`, `FIFO`, `Orderly` all 
yield `consumeMessageOrderly == true`;
   - `createConsumerGroupKeepsAnUnorderedDeliveryOrderTypeConcurrent` - `null`, 
`""`, `"   "`, `Concurrently`, `concurrently` all yield `false`, so the default 
for a plain group is unchanged.
   
   Mutation-checked: replacing the new call with `boolean consumeMessageOrderly 
= false;` fails exactly the 5 ordered cases and leaves the 5 unordered ones 
plus the other 70 tests green, so the ordered assertions are the ones pinning 
the behaviour.
   
   ### Checklist
   
   - [x] One coherent change; unrelated modifications are not bundled in
   - [x] Commit subject follows Conventional Commits (`feat:` / `fix:` / 
`refactor:` / `chore:` / `docs:` / `perf:`)
   - [x] Tests added or updated for non-trivial changes, test methods named 
`...Test` (the class is `RocketMQAdminClientImplTest`; the two new methods 
follow the existing descriptive naming used throughout it)
   - [x] New UI text has both Chinese and English entries under `web/src/i18n/` 
(no UI text; the console already submits this field)
   - [x] Architecture constraints stay green (`mvn test` runs the ArchUnit 
checks)
   - [x] New source files carry the ASF license header (no new source files)
   - [x] Documentation touched where behaviour changed (README / `docs/` / 
in-app help) - none needed; no documented contract changes, the field simply 
stops being discarded
   


-- 
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]

Reply via email to