Frun1na opened a new pull request, #4607: URL: https://github.com/apache/rocketmq-dashboard/pull/4607
### Which Issue(s) This PR Fixes - Fixes #<issue-id> ### Brief Description Direct message consumption was always audited as `SUCCESS`, even when the broker-side `consumeResult` reported a failure (`CR_ROLLBACK`, `CR_LATER`, `CR_RETURN_NULL`, ...), and when the provider threw (e.g. the client was offline) no audit record was written at all. This made the operation audit timeline (#4191) report failed direct consumes as successes. Now the audit result is derived from `consumeResult` (only `CR_SUCCESS` maps to `SUCCESS`; anything else is `FAILED`), and the exception path records `FAILED` with the error message before rethrowing, matching the existing FAILED convention used by `RocketMQAdminClientImpl`. The audit call itself is failure-tolerant (log + continue), consistent with `recordTraceQuery` in the same class. ### How Did You Test This Change? ``` $ cd server && mvn -B -ntp test -Dtest=MessageServiceTest Tests run: 21, Failures: 0, Errors: 0, Skipped: 0 ``` The two new tests failed before the fix: `auditsDirectConsumeFailureWhenConsumeResultIsNotSuccessTest` (expected `FAILED`, got `SUCCESS`) and `auditsDirectConsumeFailureWhenProviderThrowsTest` (expected a `FAILED` record, got none). ``` $ cd server && mvn -B -ntp test -Dtest='Message*Test,RocketMQMessageProviderTest' Tests run: 125, Failures: 0, Errors: 0, Skipped: 0 ``` Full suite: ``` $ cd server && mvn -B -ntp test Tests run: 2416, Failures: 1, Errors: 0, Skipped: 0 ``` The single failure is `AuthServiceSessionOverviewIntegrationTest` (`59 >= 60` second-precision DATETIME rounding), a pre-existing flaky test on the unmodified `master` baseline that #4572 addresses — unrelated to this change. ### 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` - [ ] New UI text has both Chinese and English entries under `web/src/i18n/` - [x] Architecture constraints stay green (`mvn test` runs the ArchUnit checks) - [ ] New source files carry the ASF license header - [ ] Documentation touched where behaviour changed (README / `docs/` / in-app help) -- 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]
