forked from apache/eventmesh
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
69d69d6
commit 160b9a4
Showing
19 changed files
with
295 additions
and
3 deletions.
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
...c/main/java/org/apache/eventmesh/common/protocol/grpc/common/EventMeshMessageWrapper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
...sh-common/src/main/java/org/apache/eventmesh/common/protocol/grpc/common/ProtocolKey.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
...n/src/main/java/org/apache/eventmesh/common/protocol/grpc/protos/ConsumerServiceGrpc.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
...mmon/src/main/java/org/apache/eventmesh/common/protocol/grpc/protos/EventMeshMessage.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
...main/java/org/apache/eventmesh/common/protocol/grpc/protos/EventMeshMessageOrBuilder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
...-common/src/main/java/org/apache/eventmesh/common/protocol/grpc/protos/EventmeshGrpc.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
...mesh-common/src/main/java/org/apache/eventmesh/common/protocol/grpc/protos/Heartbeat.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
...on/src/main/java/org/apache/eventmesh/common/protocol/grpc/protos/HeartbeatOrBuilder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
.../src/main/java/org/apache/eventmesh/common/protocol/grpc/protos/HeartbeatServiceGrpc.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
.../src/main/java/org/apache/eventmesh/common/protocol/grpc/protos/PublisherServiceGrpc.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
...-common/src/main/java/org/apache/eventmesh/common/protocol/grpc/protos/RequestHeader.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
...rc/main/java/org/apache/eventmesh/common/protocol/grpc/protos/RequestHeaderOrBuilder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
...tmesh-common/src/main/java/org/apache/eventmesh/common/protocol/grpc/protos/Response.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
...mon/src/main/java/org/apache/eventmesh/common/protocol/grpc/protos/ResponseOrBuilder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
...h-common/src/main/java/org/apache/eventmesh/common/protocol/grpc/protos/Subscription.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
...src/main/java/org/apache/eventmesh/common/protocol/grpc/protos/SubscriptionOrBuilder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 7 additions & 3 deletions
10
.../java/org/apache/eventmesh/runtime/core/protocol/grpc/interceptor/MetricsInterceptor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,24 @@ | ||
package org.apache.eventmesh.runtime.core.protocol.grpc.interceptor; | ||
|
||
import io.grpc.Grpc; | ||
import io.grpc.Metadata; | ||
import io.grpc.ServerCall; | ||
import io.grpc.ServerCallHandler; | ||
import io.grpc.ServerInterceptor; | ||
import org.apache.eventmesh.common.utils.IPUtils; | ||
import org.apache.eventmesh.runtime.constants.EventMeshConstants; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
public class MetricsInterceptor implements ServerInterceptor { | ||
|
||
private Logger logger = LoggerFactory.getLogger("grpc-services"); | ||
private Logger logger = LoggerFactory.getLogger(this.getClass().getName()); | ||
|
||
@Override | ||
public <ReqT, RespT> ServerCall.Listener<ReqT> interceptCall( | ||
ServerCall<ReqT, RespT> call, Metadata headers, ServerCallHandler<ReqT, RespT> next) { | ||
logger.info("Call: {}", call.getMethodDescriptor().getFullMethodName()); | ||
logger.info("cmd={}|{}|client2eventMesh|from={}|to={}", call.getMethodDescriptor().getFullMethodName(), | ||
EventMeshConstants.PROTOCOL_GRPC, call.getAttributes().get(Grpc.TRANSPORT_ATTR_REMOTE_ADDR),IPUtils.getLocalAddress()); | ||
return next.startCall(call, headers); | ||
} | ||
} | ||
} |
Oops, something went wrong.