From af1c041f44d191bc8cb1d12e013848870049d7b1 Mon Sep 17 00:00:00 2001 From: Zaki <91261012+cnzakii@users.noreply.github.com> Date: Mon, 6 May 2024 22:45:43 +0800 Subject: [PATCH] [ISSUE #3411] Do some code optimization[ReplyMessageProcessor] (#4871) --- .../core/protocol/http/processor/ReplyMessageProcessor.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/core/protocol/http/processor/ReplyMessageProcessor.java b/eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/core/protocol/http/processor/ReplyMessageProcessor.java index ce178f0f1a..55051573c2 100644 --- a/eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/core/protocol/http/processor/ReplyMessageProcessor.java +++ b/eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/core/protocol/http/processor/ReplyMessageProcessor.java @@ -73,12 +73,12 @@ public ReplyMessageProcessor(EventMeshHTTPServer eventMeshHTTPServer) { @Override public void processRequest(ChannelHandlerContext ctx, AsyncContext asyncContext) throws Exception { - HttpCommand responseEventMeshCommand; String localAddress = IPUtils.getLocalAddress(); HttpCommand request = asyncContext.getRequest(); + final String channelRemoteAddr = RemotingHelper.parseChannelRemoteAddr(ctx.channel()); cmdLogger.info("cmd={}|{}|client2eventMesh|from={}|to={}", RequestCode.get(Integer.valueOf(request.getRequestCode())), EventMeshConstants.PROTOCOL_HTTP, - RemotingHelper.parseChannelRemoteAddr(ctx.channel()), localAddress); + channelRemoteAddr, localAddress); ReplyMessageRequestHeader replyMessageRequestHeader = (ReplyMessageRequestHeader) request.getHeader(); @@ -167,7 +167,6 @@ public void processRequest(ChannelHandlerContext ctx, AsyncContext try { // body - // omsMsg.setBody(replyMessageRequestBody.getContent().getBytes(EventMeshConstants.DEFAULT_CHARSET)); event = CloudEventBuilder.from(event) .withSubject(replyTopic) .withExtension(EventMeshConstants.MSG_TYPE, EventMeshConstants.PERSISTENT)