Kris20030907 opened a new pull request, #6644:
URL: https://github.com/apache/rocketmq-dashboard/pull/6644
#6643 Slice 1
What and why
------------
LiteTopic lifecycle Slice 1 (#6643). A Lite parent topic is a normal topic
config carrying `message.type=LITE` plus the TTL attribute
`lite.topic.expiration`; child lite topics (`%LMQ%$parent$liteTopic`) are
created implicitly on first message and are only reaped by that TTL. When the
attribute is absent the broker treats it as "never expire", so a create that
does not write the TTL is already wrong policy, and a create-then-extend
sequence can be interrupted in between and leave a never-expiring parent.
This PR therefore creates the parent in a single write: the LITE message type
and the TTL land in the same `createAndUpdateTopicConfig` per master. TTL is
create-only here — later TTL changes stay owned by the existing extendTTL
path,
which reads every master before writing (all-or-nothing).
API
---
- `POST /api/liteTopic` with `CreateLiteTopicDTO`:
- `instanceId` (required) — ownership-checked write instance
- `topicPattern` (required) — `$` is rejected: it separates the parent
topic
from its lite topics in the `%LMQ%$parent$liteTopic` naming
- `ttlMinutes` (required, 1..43200 = 30 days) — protocol upper bound
- `writeQueues` / `readQueues` (optional; unset keeps the 8/8 default)
- `remark` (optional)
- Validation of the payload is bean validation; the service re-checks the
range and rejects blank input, then gates on provider capability
(501 + "LiteTopic is not supported by this provider" when unsupported).
- Creation reuses the generic topic create path
(`MetadataService.createTopic`),
so instance resolution, ownership checks, audit and the `RmqTopic` catalog
row behave exactly like topic creation elsewhere in the console.
UI
--
The LiteTopic page gains a "Create" dialog: owning instance (Apache-vendor
instances, auto-selected when only one exists), parent topic name, TTL in
minutes (prefilled with 1440 as a suggestion pending community input on the
default in #6643), optional queue counts and remark.
Tests (written red first)
-------------------------
- `LiteTopicServiceTest`: invalid input (blank instance/pattern, `$` in name,
missing/out-of-range TTL), 501 capability gate with no write, delegation to
MetadataService with LITE type + TTL, unset queue counts left at zero.
- `LiteTopicControllerTest`: bean-validation failures, TTL range 400s,
service
delegation, 501 propagation.
- `RocketMQAdminClientImplTest`: `+message.type` and `+lite.topic.expiration`
land in the same `createAndUpdateTopicConfig` call; TTL is ignored for
non-LITE types; updates do not rewrite the TTL.
- Web: API request shape test and a page-level create-flow test.
Verification: `mvn test` in `server/` (3534 tests) and the web test suite
(1618 tests) pass; lint and production build are clean.
Design discussion: #6643.
--
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]