The English version of quarkus.io is the official project site. Translated sites are community supported on a best-effort basis.

Uso de xDS gRPC

Esta página explica cómo habilitar el uso de xDS gRPC en su aplicación Quarkus.

This Quarkus xDS gRPC integration currently doesn’t support building native executables due to the issues with shaded grpc-netty library while running native IT tests.

Configurar el proyecto

Añada la extensión Quarkus gRPC xDS a su archivo de construcción:

pom.xml
<dependency>
    <groupId>io.quarkus</groupId>
    <artifactId>quarkus-grpc-xds</artifactId>
</dependency>
build.gradle
implementation("io.quarkus:quarkus-grpc-xds")
Esto añade transitoriamente la dependencia de la extensión io.quarkus:quarkus-grpc.

Configuración del servidor

Configuration property fixed at build time - All other configuration properties are overridable at runtime

Configuration property

Tipo

Por defecto

Explicitly enable use of XDS.

Environment variable: QUARKUS_GRPC_SERVER_XDS_ENABLED

Show more

boolean

false

Use secure credentials.

Environment variable: QUARKUS_GRPC_SERVER_XDS_SECURE

Show more

boolean

false

Ejemplo de configuración del servidor

Para activar el servidor xDS, utilice la siguiente configuración.

xDS must be explicitly enabled on the server, then verify you use it on the right xDS server port (default is 9000). If you want to use XdsServerCredentials set xds.secure to true.

quarkus.grpc.server.xds.enabled=true
#quarkus.grpc.server.xds.secure=true
quarkus.grpc.server.port=30051
Cuando se configura xDS, plain-text se desactiva automáticamente.

Configuración del cliente

Configuration property fixed at build time - All other configuration properties are overridable at runtime

Configuration property

Tipo

Por defecto

Explicitly enable use of XDS.

Environment variable: QUARKUS_GRPC_CLIENTS__CLIENT_NAME__XDS_ENABLED

Show more

boolean

false

Use secure credentials.

Environment variable: QUARKUS_GRPC_CLIENTS__CLIENT_NAME__XDS_SECURE

Show more

boolean

false

Optional explicit target.

Environment variable: QUARKUS_GRPC_CLIENTS__CLIENT_NAME__XDS_TARGET

Show more

string

Cuando se utiliza la propiedad de destino xDS, no se utilizan los datos de resolución de nombres, host y puerto

Ejemplo de configuración de cliente

Para activar xDS de cliente, utilice la siguiente configuración.

You can either explicitly enable xDS or you use xds name resolver, and make sure you point it to the right xDS server port (default is 9000). If you want to use XdsChannelCredentials set xds.secure to true.

#quarkus.grpc.clients.<client-name>.xds.enabled=true
#quarkus.grpc.clients.<client-name>.xds.secure=true
quarkus.grpc.clients.<client-name>.name-resolver=xds
quarkus.grpc.clients.<client-name>.port=30051
Cuando se configura xDS, plain-text se desactiva automáticamente.

Ejemplo de configuración de Kubernetes

A continuación se muestra un ejemplo de configuración adicional (necesaria) cuando se utiliza xDS gRPC con Istio Service Mesh en Kubernetes.

quarkus.kubernetes.ports.grpc.container-port=30051
quarkus.kubernetes.annotations."inject.istio.io/templates"=grpc-agent
quarkus.kubernetes.annotations."proxy.istio.io/config"={"holdApplicationUntilProxyStarts": true}