You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am Grpc Server Use Vertx Grpc Serve build.Grpc Client do not use Vertx Grpc Client.Then I Loop 10 call ,but blocked at first。
Version
4.3.7
Context
Server
public class VertxStart extends AbstractVerticle {
@Override
public void start() {
final var server = GrpcServer.server(vertx);
final var greeter = new GreeterGrpc.GreeterImplBase() {
@Override
public void sayHello(final HelloRequest request, final StreamObserver<HelloReply> responseObserver) {
System.out.println("Hello " + request.getName());
final var reply = HelloReply.newBuilder().setMessage(request.getName()).build();
responseObserver.onNext(reply);
responseObserver.onCompleted();
}
};
GrpcServiceBridge
.bridge(greeter)
.bind(server);
vertx.createHttpServer().requestHandler(server).listen(4240);
}
}
Client
public static void main(String[] args) {
new GreeterClient().start();
}
public void start() {
final var channel = NettyChannelBuilder.forAddress("127.0.0.1", 4240).usePlaintext()
.build();
final var sub = GreeterGrpc.newBlockingStub(channel);
for (int i = 0; i < 10; i++) {
System.out.println("开始idx\t" + i);
final var data = HelloRequest.newBuilder().setName("qwx" + i).build();
final var resp = sub.sayHello(data);
System.out.println("resp\t" + resp.getMessage());
System.out.println("结束idx\t" + i);
}
channel.shutdown() ;
}
}
Extra
JDK 11
The text was updated successfully, but these errors were encountered:
Questions
I am Grpc Server Use Vertx Grpc Serve build.Grpc Client do not use Vertx Grpc Client.Then I Loop 10 call ,but blocked at first。
Version
4.3.7
Context
Extra
The text was updated successfully, but these errors were encountered: