use of services.TreeMapService in project helidon by oracle.
the class PojoServiceClientIT method startServer.
@BeforeAll
public static void startServer() throws Exception {
LogConfig.configureRuntime();
GrpcRouting routing = GrpcRouting.builder().register(new TreeMapService()).register(new StringService()).build();
GrpcServerConfiguration serverConfig = GrpcServerConfiguration.builder().port(0).build();
grpcServer = GrpcServer.create(serverConfig, routing).start().toCompletableFuture().get(10, TimeUnit.SECONDS);
channel = ManagedChannelBuilder.forAddress("localhost", grpcServer.port()).usePlaintext().build();
}
use of services.TreeMapService in project helidon by oracle.
the class ProtoGrpcServiceClientIT method startServer.
@BeforeAll
public static void startServer() throws Exception {
LogConfig.configureRuntime();
GrpcRouting routing = GrpcRouting.builder().intercept(headerCheckingInterceptor).register(new TreeMapService()).register(new StringService()).build();
GrpcServerConfiguration serverConfig = GrpcServerConfiguration.builder().port(0).build();
grpcServer = GrpcServer.create(serverConfig, routing).start().toCompletableFuture().get(10, TimeUnit.SECONDS);
ClientServiceDescriptor descriptor = ClientServiceDescriptor.builder(StringServiceGrpc.getServiceDescriptor()).intercept(mediumPriorityInterceptor).intercept("Upper", highPriorityInterceptor).intercept("Lower", lowPriorityInterceptor).callCredentials(serviceCred).callCredentials("Lower", lowerMethodCred).callCredentials("Join", joinMethodCred).build();
Channel channel = ManagedChannelBuilder.forAddress("localhost", grpcServer.port()).usePlaintext().build();
grpcClient = GrpcServiceClient.create(channel, descriptor);
}
Aggregations