You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@eventmesh.apache.org by GitBox <gi...@apache.org> on 2021/06/16 07:33:11 UTC
[GitHub] [incubator-eventmesh] xwm1992 commented on a change in pull request #388: [ISSUE #366 ] remove custom-format topic concept
xwm1992 commented on a change in pull request #388:
URL: https://github.com/apache/incubator-eventmesh/pull/388#discussion_r652424697
##########
File path: eventmesh-sdk-java/src/main/java/org/apache/eventmesh/client/http/consumer/LiteConsumer.java
##########
@@ -234,7 +237,13 @@ public void run() {
}
public boolean unsubscribe(List<String> topicList, String url) throws Exception {
- subscription.removeAll(topicList);
+ Set<String> unSub = new HashSet<>(topicList);
+ for (SubscriptionItem item:subscription) {
+ if (unSub.contains(item.getTopic())) {
+ subscription.remove(item);
Review comment:
Here, may cause ConcurrentModification Exception, use iterator may be better, please take a look
--
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: dev-help@eventmesh.apache.org