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/11/02 02:44:46 UTC

[GitHub] [incubator-eventmesh] xwm1992 commented on a change in pull request #575: SDK SUPPORT CLOUD EVENT

xwm1992 commented on a change in pull request #575:
URL: https://github.com/apache/incubator-eventmesh/pull/575#discussion_r740682097



##########
File path: eventmesh-sdk-java/src/main/java/org/apache/eventmesh/client/tcp/common/MessageUtils.java
##########
@@ -76,6 +77,14 @@ public static Package asyncMessageAck(Package in) {
         return msg;
     }
 
+    public static Package asyncCloudEvent(CloudEvent cloudEvent) {
+        Package msg = new Package();
+        msg.setHeader(new Header(Command.ASYNC_MESSAGE_TO_SERVER, 0,
+                EventMeshCommon.CLOUD_EVENTS_PROTOCOL_NAME, generateRandomString(seqLength)));

Review comment:
       the package header contains `Command`, `code`, `msg`, `seq`. The `msg` correspond with `code`,so please add the new attribute to represent the protocol not use the `msg`.

##########
File path: eventmesh-sdk-java/src/main/java/org/apache/eventmesh/client/tcp/impl/SimplePubClientImpl.java
##########
@@ -145,6 +146,23 @@ public Package publish(Package msg, long timeout) throws Exception {
         return io(msg, timeout);
     }
 
+
+    @Override
+    public Package publish(CloudEvent cloudEvent, long timeout) throws Exception {
+        Package msg = MessageUtils.asyncCloudEvent(cloudEvent);
+        logger.info("SimplePubClientImpl|{}|publish|send|type={}|msg={}", clientNo,

Review comment:
       please add the protocol type in logging




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