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 ef9e37c20 [ISSUE #3407] Make this anonymous inner class a 
lambda[SendSyncMessageProcessor]
ef9e37c20 is described below

commit ef9e37c20b5832727cb2e473da19f84e26cdd186
Author: Sunstreaker <[email protected]>
AuthorDate: Fri May 5 08:07:28 2023 +0530

    [ISSUE #3407] Make this anonymous inner class a 
lambda[SendSyncMessageProcessor]
    
    Make this anonymous inner class a lambda
---
 .../http/processor/SendSyncMessageProcessor.java   | 22 ++++++++++------------
 1 file changed, 10 insertions(+), 12 deletions(-)

diff --git 
a/eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/core/protocol/http/processor/SendSyncMessageProcessor.java
 
b/eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/core/protocol/http/processor/SendSyncMessageProcessor.java
index f93fb7855..e7541ea5a 100644
--- 
a/eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/core/protocol/http/processor/SendSyncMessageProcessor.java
+++ 
b/eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/core/protocol/http/processor/SendSyncMessageProcessor.java
@@ -250,19 +250,17 @@ public class SendSyncMessageProcessor implements 
HttpRequestProcessor {
 
         final long startTime = System.currentTimeMillis();
 
-        final CompleteHandler<HttpCommand> handler = new 
CompleteHandler<HttpCommand>() {
-            @Override
-            public void onResponse(final HttpCommand httpCommand) {
-                try {
-                    if (log.isDebugEnabled()) {
-                        log.debug("{}", httpCommand);
-                    }
-                    eventMeshHTTPServer.sendResponse(ctx, 
httpCommand.httpResponse());
-                    
summaryMetrics.recordHTTPReqResTimeCost(System.currentTimeMillis() - 
request.getReqTime());
-                } catch (Exception ex) {
-                    log.error("onResponse error", ex);
-                    // ignore
+        final CompleteHandler<HttpCommand> handler = httpCommand -> {
+            try {
+                if (log.isDebugEnabled()) {
+                    log.debug("{}", httpCommand);
                 }
+                eventMeshHTTPServer.sendResponse(ctx, 
httpCommand.httpResponse());
+                
eventMeshHTTPServer.getMetrics().getSummaryMetrics().recordHTTPReqResTimeCost(
+                    System.currentTimeMillis() - 
asyncContext.getRequest().getReqTime());
+            } catch (Exception ex) {
+                log.error("onResponse error", ex);
+                // ignore
             }
         };
 


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

Reply via email to