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 2023/01/12 15:41:25 UTC

[GitHub] [incubator-eventmesh] horoc commented on a diff in pull request #2902: [ISSUE #2901] EventMeshGrpcConsumerTest repeat subscribe bug

horoc commented on code in PR #2902:
URL: https://github.com/apache/incubator-eventmesh/pull/2902#discussion_r1068282482


##########
eventmesh-sdk-java/src/main/java/org/apache/eventmesh/client/grpc/consumer/EventMeshGrpcConsumer.java:
##########
@@ -130,7 +144,7 @@ public void subscribe(List<SubscriptionItem> subscriptionItems) {
 
     private void addSubscription(List<SubscriptionItem> subscriptionItems, String url) {
         for (SubscriptionItem item : subscriptionItems) {
-            subscriptionMap.put(item.getTopic(), new SubscriptionInfo(item, url));
+            subscriptionMap.putIfAbsent(item.getTopic(), new SubscriptionInfo(item, url));

Review Comment:
   Shall we update the subscription info if the topic exists?



-- 
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: dev-unsubscribe@eventmesh.apache.org

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