@Test public void helloProxyShouldRoundtripGrpcRequests() throws InterruptedException, ExecutionException, TimeoutException { String msg = proxyServiceClient.proxyViaGrpc("Steve").invoke() .toCompletableFuture().get(5, SECONDS); assertEquals("Hi Steve (gRPC)", msg); }
@Override public ServiceCall<NotUsed, String> proxyViaGrpc(String id) { return req -> greeterClient .sayHello( HelloRequest .newBuilder() .setName(id) .build() ).thenApply( HelloReply::getMessage ); }
HelloProxyServiceImpl implements HelloProxyService { @Override public ServiceCall<NotUsed, String> proxyViaGrpc(String id) { return req -> greeterClient .sayHello( HelloRequest .newBuilder() .setName(id) .build() ).thenApply( HelloReply::getMessage ); } }
HelloProxyServiceImpl implements HelloProxyService { @Override public ServiceCall<NotUsed, String> proxyViaGrpc(String id) { return req -> greeterClient .sayHello( HelloRequest .newBuilder() .setName(id) .build() ).thenApply( HelloReply::getMessage ); } @Inject  HelloProxyServiceImpl(
        HelloService helloService,
        GreeterServiceClient greeterClient); }
HelloProxyServiceImpl implements HelloProxyService { @Override public ServiceCall<NotUsed, String> proxyViaGrpc(String id) { return req -> greeterClient .sayHello( HelloRequest .newBuilder() .setName(id) .build() ).thenApply( HelloReply::getMessage ); } @Inject  HelloProxyServiceImpl(
        HelloService helloService,
        GreeterServiceClient greeterClient); @Override ServiceCall<NotUsed, String> proxyViaHttp(String id); @Override ServiceCall<NotUsed, String> proxyViaGrpc(String id); }
HelloProxyServiceImpl implements HelloProxyService { @Override public ServiceCall<NotUsed, String> proxyViaGrpc(String id) { return req -> greeterClient .sayHello( HelloRequest .newBuilder() .setName(id) .build() ).thenApply( HelloReply::getMessage ); } @Inject  HelloProxyServiceImpl(
        HelloService helloService,
        GreeterServiceClient greeterClient); @Override ServiceCall<NotUsed, String> proxyViaHttp(String id); @Override ServiceCall<NotUsed, String> proxyViaGrpc(String id);  }