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/incubator-eventmesh.git


The following commit(s) were added to refs/heads/master by this push:
     new d9fdcb1a5 fix issue2595
     new 26288e67d Merge pull request #2621 from jonyangx/issue2595
d9fdcb1a5 is described below

commit d9fdcb1a5cd6daa8ef5ef989a52ae2f0b3a90170
Author: jonyangx <[email protected]>
AuthorDate: Sat Dec 17 16:25:44 2022 +0800

    fix issue2595
---
 .../core/protocol/grpc/service/HeartbeatService.java | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git 
a/eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/core/protocol/grpc/service/HeartbeatService.java
 
b/eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/core/protocol/grpc/service/HeartbeatService.java
index 94491b6c6..962cf401b 100644
--- 
a/eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/core/protocol/grpc/service/HeartbeatService.java
+++ 
b/eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/core/protocol/grpc/service/HeartbeatService.java
@@ -34,22 +34,22 @@ import io.grpc.stub.StreamObserver;
 
 public class HeartbeatService extends 
HeartbeatServiceGrpc.HeartbeatServiceImplBase {
 
-    private final Logger logger = 
LoggerFactory.getLogger(ProducerService.class);
+    private static final Logger LOGGER = 
LoggerFactory.getLogger(HeartbeatService.class);
 
-    private final EventMeshGrpcServer eventMeshGrpcServer;
+    private final transient EventMeshGrpcServer eventMeshGrpcServer;
 
-    private final ThreadPoolExecutor threadPoolExecutor;
+    private final transient ThreadPoolExecutor threadPoolExecutor;
 
-    public HeartbeatService(EventMeshGrpcServer eventMeshGrpcServer,
-                            ThreadPoolExecutor threadPoolExecutor) {
+    public HeartbeatService(final EventMeshGrpcServer eventMeshGrpcServer,
+                            final ThreadPoolExecutor threadPoolExecutor) {
         this.eventMeshGrpcServer = eventMeshGrpcServer;
         this.threadPoolExecutor = threadPoolExecutor;
     }
 
     public void heartbeat(Heartbeat request, StreamObserver<Response> 
responseObserver) {
-        logger.info("cmd={}|{}|client2eventMesh|from={}|to={}",
-            "heartbeat", EventMeshConstants.PROTOCOL_GRPC,
-            request.getHeader().getIp(), 
eventMeshGrpcServer.getEventMeshGrpcConfiguration().eventMeshIp);
+        LOGGER.info("cmd={}|{}|client2eventMesh|from={}|to={}",
+                "heartbeat", EventMeshConstants.PROTOCOL_GRPC, 
request.getHeader().getIp(),
+                
eventMeshGrpcServer.getEventMeshGrpcConfiguration().eventMeshIp);
 
         EventEmitter<Response> emitter = new EventEmitter<>(responseObserver);
         threadPoolExecutor.submit(() -> {
@@ -57,8 +57,8 @@ public class HeartbeatService extends 
HeartbeatServiceGrpc.HeartbeatServiceImplB
             try {
                 heartbeatProcessor.process(request, emitter);
             } catch (Exception e) {
-                logger.error("Error code {}, error message {}", 
StatusCode.EVENTMESH_HEARTBEAT_ERR.getRetCode(),
-                    StatusCode.EVENTMESH_HEARTBEAT_ERR.getErrMsg(), e);
+                LOGGER.error("Error code {}, error message {}", 
StatusCode.EVENTMESH_HEARTBEAT_ERR.getRetCode(),
+                        StatusCode.EVENTMESH_HEARTBEAT_ERR.getErrMsg(), e);
                 
ServiceUtils.sendRespAndDone(StatusCode.EVENTMESH_HEARTBEAT_ERR, 
e.getMessage(), emitter);
             }
         });


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

Reply via email to