seninel部署
Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
李豪 03922dbf6c
Enhancement/normalize metric field (#170)
6 lat temu
..
src Enhancement/normalize metric field (#170) 6 lat temu
README.md Welcome to the world, Sentinel 6 lat temu
pom.xml Bump version to 0.2.1-SNAPSHOT 6 lat temu

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();