This is an automated email from the ASF dual-hosted git repository.
lizhimins pushed a commit to branch rocketmq-studio
in repository https://gitbox.apache.org/repos/asf/rocketmq-dashboard.git
The following commit(s) were added to refs/heads/rocketmq-studio by this push:
new 7e4d35f47 fix(aliyun): report a lite topic as LITE instead of NORMAL
(#4844)
7e4d35f47 is described below
commit 7e4d35f479ded25f2be4e7b2c9d688f32c558a14
Author: Wang1rrr <[email protected]>
AuthorDate: Thu Sep 24 10:45:38 2026 +0800
fix(aliyun): report a lite topic as LITE instead of NORMAL (#4844)
`AliyunConverters.toTopicType` is the only place an Aliyun `messageType`
string becomes a `TopicVO.type`, and it hand-rolled a switch over four values
with `default: NORMAL`, so the documented LITE message type fell through to
NORMAL while the Apache and Tencent providers resolve the same string with
`TopicType.valueOf`. Every read path built on the converter then misreported an
Aliyun lite topic: the list tag, the LiteTopic filter, the cloud test-message
guard, the CSV export the imp [...]
---
.../studio/provider/alibaba/AliyunConverters.java | 10 ++++--
.../provider/alibaba/AliyunConvertersTest.java | 36 ++++++++++++++++++++++
2 files changed, 44 insertions(+), 2 deletions(-)
diff --git
a/server/src/main/java/org/apache/rocketmq/studio/provider/alibaba/AliyunConverters.java
b/server/src/main/java/org/apache/rocketmq/studio/provider/alibaba/AliyunConverters.java
index f488cd8cf..e94d0fd7a 100644
---
a/server/src/main/java/org/apache/rocketmq/studio/provider/alibaba/AliyunConverters.java
+++
b/server/src/main/java/org/apache/rocketmq/studio/provider/alibaba/AliyunConverters.java
@@ -145,9 +145,15 @@ final class AliyunConverters {
return TopicType.DELAY;
case "TRANSACTION":
return TopicType.TRANSACTION;
+ case "LITE":
+ // Aliyun RocketMQ 5.0 publishes lite topics as a first class
message type
+ // (messageType=LITE), spelled exactly like TopicType.LITE.
The Apache and Tencent
+ // converters already resolve it through TopicType.valueOf, so
only this switch
+ // needs the case to keep the three vendors reporting the same
type.
+ return TopicType.LITE;
default:
- // Unknown message types fall back to NORMAL so read paths (web
- // detail, AI rmq.topic.list) never see a null type, matching
the
+ // Message types this Studio build does not know yet fall back
to NORMAL so read
+ // paths (web detail, AI rmq.topic.list) never see a null
type, matching the
// Apache provider's parseTopicType fallback.
return TopicType.NORMAL;
}
diff --git
a/server/src/test/java/org/apache/rocketmq/studio/provider/alibaba/AliyunConvertersTest.java
b/server/src/test/java/org/apache/rocketmq/studio/provider/alibaba/AliyunConvertersTest.java
index f686e5ebb..de1bf8f72 100644
---
a/server/src/test/java/org/apache/rocketmq/studio/provider/alibaba/AliyunConvertersTest.java
+++
b/server/src/test/java/org/apache/rocketmq/studio/provider/alibaba/AliyunConvertersTest.java
@@ -18,6 +18,9 @@ package org.apache.rocketmq.studio.provider.alibaba;
import
com.aliyun.sdk.service.rocketmq20220801.models.ListConsumerGroupSubscriptionsResponseBody;
import
com.aliyun.sdk.service.rocketmq20220801.models.ListInstancesResponseBody;
+import com.aliyun.sdk.service.rocketmq20220801.models.ListTopicsResponseBody;
+import org.apache.rocketmq.studio.common.domain.enums.TopicType;
+import org.apache.rocketmq.studio.instance.topic.TopicVO;
import org.apache.rocketmq.studio.instance.group.SubscriptionEntryVO;
import org.junit.jupiter.api.Test;
@@ -25,6 +28,39 @@ import static org.assertj.core.api.Assertions.assertThat;
class AliyunConvertersTest {
+ @Test
+ void toTopicTypeShouldMapEveryDocumentedAliyunMessageTypeTest() {
+
assertThat(AliyunConverters.toTopicType("NORMAL")).isEqualTo(TopicType.NORMAL);
+
assertThat(AliyunConverters.toTopicType("FIFO")).isEqualTo(TopicType.FIFO);
+
assertThat(AliyunConverters.toTopicType("DELAY")).isEqualTo(TopicType.DELAY);
+
assertThat(AliyunConverters.toTopicType("TRANSACTION")).isEqualTo(TopicType.TRANSACTION);
+
assertThat(AliyunConverters.toTopicType("LITE")).isEqualTo(TopicType.LITE);
+ }
+
+ @Test
+ void toTopicTypeShouldAcceptTheLowerCaseSpellingOfALiteTopicTest() {
+
assertThat(AliyunConverters.toTopicType("lite")).isEqualTo(TopicType.LITE);
+ }
+
+ @Test
+ void toTopicTypeShouldFallBackToNormalOnlyForAnUnknownMessageTypeTest() {
+
assertThat(AliyunConverters.toTopicType(null)).isEqualTo(TopicType.NORMAL);
+ assertThat(AliyunConverters.toTopicType("
")).isEqualTo(TopicType.NORMAL);
+
assertThat(AliyunConverters.toTopicType("SCHEDULED")).isEqualTo(TopicType.NORMAL);
+ }
+
+ @Test
+ void toTopicVoShouldKeepALiteTopicTypeTest() {
+ ListTopicsResponseBody.List data =
ListTopicsResponseBody.List.builder()
+ .topicName("session-lite")
+ .messageType("LITE")
+ .build();
+
+ TopicVO vo = AliyunConverters.toTopicVO(data, "7");
+
+ assertThat(vo.getType()).isEqualTo(TopicType.LITE);
+ }
+
@Test
void toInstanceOptionShouldClampCountsOutsideTheIntegerRange() {
ListInstancesResponseBody.List data =
ListInstancesResponseBody.List.builder()