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 09:06:01 UTC

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

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



##########
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:
       ok

##########
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:
       ok




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