diff --git a/namesrv/src/test/java/org/apache/rocketmq/namesrv/routeinfo/RouteInfoManagerNewTest.java b/namesrv/src/test/java/org/apache/rocketmq/namesrv/routeinfo/RouteInfoManagerNewTest.java index 6002d1f5a4d..b52cf50740a 100644 --- a/namesrv/src/test/java/org/apache/rocketmq/namesrv/routeinfo/RouteInfoManagerNewTest.java +++ b/namesrv/src/test/java/org/apache/rocketmq/namesrv/routeinfo/RouteInfoManagerNewTest.java @@ -130,7 +130,6 @@ public void getAllTopicList() { topicList = TopicList.decode(content, TopicList.class); assertThat(topicList.getTopicList()).contains("TestTopic", "TestTopic1", "TestTopic2"); } - @Test public void registerBroker() { // Register master broker diff --git a/remoting/src/main/java/org/apache/rocketmq/remoting/protocol/body/TopicList.java b/remoting/src/main/java/org/apache/rocketmq/remoting/protocol/body/TopicList.java index 30edfb5a987..0de0bae7e3c 100644 --- a/remoting/src/main/java/org/apache/rocketmq/remoting/protocol/body/TopicList.java +++ b/remoting/src/main/java/org/apache/rocketmq/remoting/protocol/body/TopicList.java @@ -17,11 +17,11 @@ package org.apache.rocketmq.remoting.protocol.body; import java.util.Set; -import java.util.concurrent.CopyOnWriteArraySet; +import java.util.concurrent.ConcurrentHashMap; import org.apache.rocketmq.remoting.protocol.RemotingSerializable; public class TopicList extends RemotingSerializable { - private Set topicList = new CopyOnWriteArraySet<>(); + private Set topicList = ConcurrentHashMap.newKeySet(); private String brokerAddr; public Set getTopicList() {