File tree Expand file tree Collapse file tree 4 files changed +26
-0
lines changed
io/vertx/example/jpms/grpc Expand file tree Collapse file tree 4 files changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -119,6 +119,23 @@ Or use the launcher:
119119./target/maven-jlink/default/bin/grpc-server
120120----
121121
122+ You can use https://github.com/fullstorydev/grpcurl[gRPCurl] to interact with the server and its hosted services:
123+
124+ [source,shell]
125+ ----
126+ > grpcurl -plaintext localhost:8080 list
127+ grpc.reflection.v1.ServerReflection
128+ helloworld.Greeter
129+
130+ > grpcurl -plaintext localhost:8080 list helloworld.Greeter
131+ helloworld.Greeter.SayHello
132+
133+ > grpcurl -plaintext -d '{"name":"Julien"}' localhost:8080 helloworld.Greeter.SayHello
134+ {
135+ "message": "Hello Julien"
136+ }
137+ ----
138+
122139== Native transports
123140
124141A simple link:src/main/java/io/vertx/example/jpms/http2/Server.java[HTTP server] running with Netty native transports kqueue/epoll/io_uring.
Original file line number Diff line number Diff line change 8080 </exclusion >
8181 </exclusions >
8282 </dependency >
83+ <dependency >
84+ <groupId >io.vertx</groupId >
85+ <artifactId >vertx-grpc-reflection</artifactId >
86+ </dependency >
8387 <dependency >
8488 <groupId >com.google.protobuf</groupId >
8589 <artifactId >protobuf-java</artifactId >
Original file line number Diff line number Diff line change 77import io .vertx .example .jpms .grpc .helloworld .GreeterGrpcService ;
88import io .vertx .example .jpms .grpc .helloworld .HelloReply ;
99import io .vertx .example .jpms .grpc .helloworld .HelloRequest ;
10+ import io .vertx .grpc .reflection .ReflectionService ;
1011import io .vertx .grpc .server .GrpcServer ;
1112
1213public class Server extends VerticleBase {
@@ -33,6 +34,9 @@ public Future<HelloReply> sayHello(HelloRequest request) {
3334 };
3435 grpcServer .addService (service );
3536
37+ // Add reflection service
38+ grpcServer .addService (ReflectionService .v1 ());
39+
3640 HttpServer server = vertx
3741 .createHttpServer (
3842 new HttpServerOptions ()
Original file line number Diff line number Diff line change 3030
3131 // SQL client template
3232 requires io .vertx .sql .client .templates ;
33+ requires io .vertx .grpc .reflection ;
3334
3435 exports io .vertx .example .jpms .sqlclient ;
3536 exports io .vertx .example .jpms .sqltemplate ;
You can’t perform that action at this time.
0 commit comments