You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@eventmesh.apache.org by mi...@apache.org on 2023/05/25 02:36:48 UTC
[eventmesh] branch master updated: [ISSUE #3908] Code optimization [HttpRequestProcessor]
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 <se...@foxmail.com>
AuthorDate: Thu May 25 10:36:43 2023 +0800
[ISSUE #3908] Code optimization [HttpRequestProcessor]
Signed-off-by: Yixiang Zhao <se...@foxmail.com>
---
.../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: commits-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: commits-help@eventmesh.apache.org