This is an automated email from the ASF dual-hosted git repository.

mikexue pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/eventmesh.git


The following commit(s) were added to refs/heads/master by this push:
     new c27463427 [ISSUE #3908] Code optimization [HttpRequestProcessor]
c27463427 is described below

commit c2746342722054bc26bc71d740dc482ad7e6b629
Author: Yixiang Zhao <[email protected]>
AuthorDate: Thu May 25 10:36:43 2023 +0800

    [ISSUE #3908] Code optimization [HttpRequestProcessor]
    
    Signed-off-by: Yixiang Zhao <[email protected]>
---
 .../core/protocol/http/processor/inf/HttpRequestProcessor.java     | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git 
a/eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/core/protocol/http/processor/inf/HttpRequestProcessor.java
 
b/eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/core/protocol/http/processor/inf/HttpRequestProcessor.java
index 772503928..893d35c55 100644
--- 
a/eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/core/protocol/http/processor/inf/HttpRequestProcessor.java
+++ 
b/eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/core/protocol/http/processor/inf/HttpRequestProcessor.java
@@ -28,6 +28,9 @@ import org.apache.commons.lang3.StringUtils;
 import java.lang.reflect.Method;
 import java.util.Objects;
 
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
 import io.cloudevents.CloudEvent;
 import io.netty.channel.ChannelHandlerContext;
 
@@ -36,6 +39,8 @@ import io.netty.channel.ChannelHandlerContext;
  */
 public interface HttpRequestProcessor {
 
+    Logger log = LoggerFactory.getLogger(HttpRequestProcessor.class);
+
     void processRequest(final ChannelHandlerContext ctx, final 
AsyncContext<HttpCommand> asyncContext)
         throws Exception;
 
@@ -53,7 +58,7 @@ public interface HttpRequestProcessor {
             HttpCommand response = req.createHttpCommandResponse(respHeader, 
(E) o);
             asyncContext.onComplete(response);
         } catch (Exception e) {
-            e.printStackTrace();
+            log.error("response failed", e);
         }
     }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to