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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]