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 2022/12/07 03:32:15 UTC

[GitHub] [incubator-eventmesh] MajorHe1 commented on a diff in pull request #2470: [ISSUE #2469]add synchronized bracket in EventMeshMessageTCPSubClient

MajorHe1 commented on code in PR #2470:
URL: https://github.com/apache/incubator-eventmesh/pull/2470#discussion_r1041719271


##########
eventmesh-sdk-java/src/main/java/org/apache/eventmesh/client/tcp/impl/eventmeshmessage/EventMeshMessageTCPSubClient.java:
##########
@@ -73,9 +73,11 @@ public void reconnect() throws EventMeshException {
             super.reconnect();
             hello();
             if (!CollectionUtils.isEmpty(subscriptionItems)) {
-                for (SubscriptionItem item : subscriptionItems) {
-                    Package request = MessageUtils.subscribe(item.getTopic(), item.getMode(), item.getType());
-                    this.io(request, EventMeshCommon.DEFAULT_TIME_OUT_MILLS);
+                synchronized (subscriptionItems) {
+                    for (SubscriptionItem item : subscriptionItems) {

Review Comment:
   What's you mean that add synchronize key word in subscribe() method in current class or MessageUtils.subscribe() ?



-- 
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