seninel部署
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Eric Zhao 48286e0ff8 Bump version to 1.5.1 (release) пре 5 година
..
src Update gRPC adapter test cases пре 6 година
README.md Update document to meet Markdown lint пре 6 година
pom.xml Bump version to 1.5.1 (release) пре 5 година

README.md

Sentinel gRPC Adapter

Sentinel gRPC Adapter provides client and server interceptor for gRPC services.

Note that currently the interceptor only supports unary methods in gRPC. In some circumstances (e.g. asynchronous call), the RT metrics might not be accurate.

Client Interceptor

Example:

public class ServiceClient {

    private final ManagedChannel channel;

    ServiceClient(String host, int port) {
        this.channel = ManagedChannelBuilder.forAddress(host, port)
            .intercept(new SentinelGrpcClientInterceptor()) // Add the client interceptor.
            .build();
        // Init your stub here.
    }
}

Server Interceptor

Example:

import io.grpc.Server;

Server server = ServerBuilder.forPort(port)
     .addService(new MyServiceImpl()) // Add your service.
     .intercept(new SentinelGrpcServerInterceptor()) // Add the server interceptor.
     .build();