Skip to content

Files

Latest commit

af491a1 · Mar 9, 2022

History

History
This branch is 11 commits ahead of, 582 commits behind quarkusio/quarkus-quickstarts:main.

grpc-tls-quickstart

Quarkus gRPC TLS Quickstart

This project illustrates how to expose and consume TLS-secured gRPC services with Quarkus.

Start the application

The application can be started using:

mvn quarkus:dev

Accessing the application

You can access the REST endpoint with curl:

curl localhost:8080/hello/blocking/World

or

curl localhost:8080/hello/mutiny/World

The project has gRPC server reflection enabled (see application.properties), so you can also access the gRPC service directly with grpcurl.

grpcurl --cacert src/main/resources/tls/ca.pem -d '{"name": "World!"}' localhost:9000 helloworld.Greeter/SayHello

Anatomy

The application has of 2 components:

  • HelloWorldService - a hello-world gRPC service
  • HelloWorldEndpoint - a REST endpoint that uses Quarkus gRPC client to communicate with the service

The project is configured with application.properties.

Running in native

You can compile the application into a native binary using:

mvn clean install -Pnative

and run with: ./target/grpc-tls-quickstart-1.0.0-SNAPSHOT-runner