Pil0tXia commented on code in PR #4229:
URL: https://github.com/apache/eventmesh/pull/4229#discussion_r1266253008
##########
eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/core/protocol/tcp/client/task/MessageTransferTask.java:
##########
@@ -181,25 +181,20 @@ public void run() {
private CloudEvent addTimestamp(CloudEvent event, Command cmd, long
sendTime) {
if (cmd == RESPONSE_TO_SERVER) {
- event = CloudEventBuilder.from(event)
- .withExtension(EventMeshConstants.RSP_C2EVENTMESH_TIMESTAMP,
- String.valueOf(startTime))
- .withExtension(EventMeshConstants.RSP_EVENTMESH2MQ_TIMESTAMP,
- String.valueOf(sendTime))
- .withExtension(EventMeshConstants.RSP_SEND_EVENTMESH_IP,
-
eventMeshTCPServer.getEventMeshTCPConfiguration().getEventMeshServerIp())
- .build();
+ return getCloudEvent(event, sendTime,
EventMeshConstants.RSP_C2EVENTMESH_TIMESTAMP,
EventMeshConstants.RSP_EVENTMESH2MQ_TIMESTAMP,
+ EventMeshConstants.RSP_SEND_EVENTMESH_IP);
} else {
- event = CloudEventBuilder.from(event)
- .withExtension(EventMeshConstants.REQ_C2EVENTMESH_TIMESTAMP,
- String.valueOf(startTime))
- .withExtension(EventMeshConstants.REQ_EVENTMESH2MQ_TIMESTAMP,
- String.valueOf(sendTime))
- .withExtension(EventMeshConstants.REQ_SEND_EVENTMESH_IP,
-
eventMeshTCPServer.getEventMeshTCPConfiguration().getEventMeshServerIp())
- .build();
+ return getCloudEvent(event, sendTime,
EventMeshConstants.REQ_C2EVENTMESH_TIMESTAMP,
EventMeshConstants.REQ_EVENTMESH2MQ_TIMESTAMP,
+ EventMeshConstants.REQ_SEND_EVENTMESH_IP);
Review Comment:
You may give these parameters newlines to improve readability, or create a
new local variable to pass the parameter. I would suggest the former.
--
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]