Configuration Properties
Configuration properties for the gRPC starter project.
This page was generated by spring-configuration-property-documenter.
Table of Contents
- grpc-client-boot-autoconfigure
-
grpc.client.tls.key-manager -
grpcstarter.client.GrpcClientProperties$Tls$KeyManager
-
grpc.client.tls.trust-manager -
grpcstarter.client.GrpcClientProperties$Tls$TrustManager
-
grpc.client.in-process -
grpcstarter.client.GrpcClientProperties$InProcess
-
grpc.client.refresh -
grpcstarter.client.GrpcClientProperties$Refresh
-
grpc.client.retry -
grpcstarter.client.GrpcClientProperties$Retry
-
grpc.client.tls -
grpcstarter.client.GrpcClientProperties$Tls
-
- grpc-server-boot-autoconfigure
-
grpc.server.tls.key-manager -
grpcstarter.server.GrpcServerProperties$Tls$KeyManager
-
grpc.server.tls.trust-manager -
grpcstarter.server.GrpcServerProperties$Tls$TrustManager
-
grpc.server.health.datasource -
grpcstarter.server.GrpcServerProperties$Health$DataSource
-
grpc.server.health.redis -
grpcstarter.server.GrpcServerProperties$Health$Redis
-
grpc.server.channelz -
grpcstarter.server.GrpcServerProperties$Channelz
-
grpc.server.exception-handling -
grpcstarter.server.GrpcServerProperties$ExceptionHandling
-
grpc.server.health -
grpcstarter.server.GrpcServerProperties$Health
-
grpc.server.in-process -
grpcstarter.server.GrpcServerProperties$InProcess
-
grpc.server.reflection -
grpcstarter.server.GrpcServerProperties$Reflection
-
grpc.server.response -
grpcstarter.server.GrpcServerProperties$Response
-
grpc.server.tls -
grpcstarter.server.GrpcServerProperties$Tls
-
- grpc-metrics
- grpc-test
- grpc-tracing
- grpc-transcoding
- grpc-validation
grpc-client-boot-autoconfigure
grpc.client.tls.key-manager
Class: grpcstarter.client.GrpcClientProperties$Tls$KeyManager
Key | Type | Description | Default value | Deprecation |
---|---|---|---|---|
cert-chain | org.springframework.core.io.Resource | @see TlsChannelCredentials.Builder#getCertificateChain() | ||
private-key | org.springframework.core.io.Resource | @see TlsChannelCredentials.Builder#getPrivateKey() | ||
private-key-password | java.lang.String | @see TlsChannelCredentials.Builder#getPrivateKeyPassword() |
grpc.client.tls.trust-manager
Class: grpcstarter.client.GrpcClientProperties$Tls$TrustManager
Key | Type | Description | Default value | Deprecation |
---|---|---|---|---|
root-certs | org.springframework.core.io.Resource | @see TlsChannelCredentials.Builder#getRootCertificates() |
grpc.client
Class: grpcstarter.client.GrpcClientProperties
Key | Type | Description | Default value | Deprecation |
---|---|---|---|---|
authority | java.lang.String | Default authority. <p> e.g. localhost:8080 </p> | ||
base-packages | java.util.List<java.lang.String> | Base packages to scan for gRPC stubs. <p> This value will merge with {@link EnableGrpcClients#basePackages}, only takes effect if {@link EnableGrpcClients#basePackages} is not set. </p> <p> The advantage of using configuration is no need to introduce external annotations. </p> | ||
channels | java.util.List<grpcstarter.client.GrpcClientProperties$Channel> | Channels configuration. | ||
compression | java.lang.String | Compression configuration. @see AbstractStub#withCompression(String) | ||
deadline | java.lang.Long | Deadline after in milliseconds, default value is 5000. @see AbstractStub#withDeadline(Deadline) @since 3.2.0 | ||
enabled | java.lang.Boolean | Whether to enable gRPC client autoconfiguration, default true. | true | |
max-inbound-message-size | org.springframework.util.unit.DataSize | Default max inbound message size, default value is 4MB. @see DataSize @see GrpcUtil#DEFAULT_MAX_MESSAGE_SIZE | ||
max-inbound-metadata-size | org.springframework.util.unit.DataSize | Default max metadata size, default value is 8KB. @see DataSize @see GrpcUtil#DEFAULT_MAX_HEADER_LIST_SIZE | ||
max-outbound-message-size | org.springframework.util.unit.DataSize | Default max outbound message size. @see DataSize @see AbstractStub#withMaxOutboundMessageSize(int) | ||
metadata | java.util.List<grpcstarter.client.GrpcClientProperties$Metadata> | Default metadata will be added to all the gRPC requests. | ||
shutdown-timeout | java.lang.Long | Channel shutdown timeout in milliseconds, default value is 5000. | 5000 | |
warn-unused-config-enabled | java.lang.Boolean | Whether to enable warn unused config, default true. | true |
grpc.client.in-process
Class: grpcstarter.client.GrpcClientProperties$InProcess
Key | Type | Description | Default value | Deprecation |
---|---|---|---|---|
name | java.lang.String | In-process client name. <p> If set, will create an in-process channel by default, usually for testing. </p> |
grpc.client.refresh
Class: grpcstarter.client.GrpcClientProperties$Refresh
Key | Type | Description | Default value | Deprecation |
---|---|---|---|---|
enabled | java.lang.Boolean | Whether to enable refresh grpc clients, default false. <p> NOTE: this feature needs 'spring-cloud-context' dependency in the classpath. </p> | false |
grpc.client.retry
Class: grpcstarter.client.GrpcClientProperties$Retry
Key | Type | Description | Default value | Deprecation |
---|---|---|---|---|
enabled | java.lang.Boolean | Whether to enable retry. @see io.grpc.ManagedChannelBuilder#enableRetry() @see io.grpc.ManagedChannelBuilder#disableRetry() | ||
max-retry-attempts | java.lang.Integer | Maximum number of attempts to retry. @see io.grpc.ManagedChannelBuilder#maxRetryAttempts(int) | ||
per-rpc-buffer-limit | org.springframework.util.unit.DataSize | The maximum number of retry buffer entries per RPC. @see io.grpc.ManagedChannelBuilder#perRpcBufferLimit(long) | ||
retry-buffer-size | org.springframework.util.unit.DataSize | The maximum number of retry buffer entries. @see io.grpc.ManagedChannelBuilder#retryBufferSize(long) |
grpc.client.tls
Class: grpcstarter.client.GrpcClientProperties$Tls
Key | Type | Description | Default value | Deprecation |
---|
grpc-server-boot-autoconfigure
grpc.server.tls.key-manager
Class: grpcstarter.server.GrpcServerProperties$Tls$KeyManager
Key | Type | Description | Default value | Deprecation |
---|---|---|---|---|
cert-chain | org.springframework.core.io.Resource | @see TlsServerCredentials.Builder#getCertificateChain() | ||
private-key | org.springframework.core.io.Resource | @see TlsServerCredentials.Builder#getPrivateKey() | ||
private-key-password | java.lang.String | @see TlsServerCredentials.Builder#getPrivateKeyPassword() |
grpc.server.tls.trust-manager
Class: grpcstarter.server.GrpcServerProperties$Tls$TrustManager
Key | Type | Description | Default value | Deprecation |
---|---|---|---|---|
root-certs | org.springframework.core.io.Resource | @see TlsServerCredentials.Builder#getRootCertificates() |
grpc.server.health.datasource
Class: grpcstarter.server.GrpcServerProperties$Health$DataSource
Key | Type | Description | Default value | Deprecation |
---|---|---|---|---|
enabled | java.lang.Boolean | Whether to enable datasource health check, default true. | true | |
service | java.lang.String | The service name that will be used for datasource health check, default value is 'datasource'. | datasource | |
timeout | java.lang.Integer | {@link #validationQuery} timeout, unit seconds. | ||
validation-query | java.lang.String | The SQL query that will be used to validate datasource connection, default value is 'SELECT 1'. | SELECT 1 |
grpc.server.health.redis
Class: grpcstarter.server.GrpcServerProperties$Health$Redis
Key | Type | Description | Default value | Deprecation |
---|---|---|---|---|
enabled | java.lang.Boolean | Whether to enable redis health check, default true. | true | |
service | java.lang.String | The service name that will be used for redis health check, default value is 'redis'. | redis |
grpc.server
Class: grpcstarter.server.GrpcServerProperties
Key | Type | Description | Default value | Deprecation |
---|---|---|---|---|
enable-empty-server | java.lang.Boolean | Whether to start a gRPC server when no service found, default true. | true | |
enabled | java.lang.Boolean | Whether to enable gRPC server autoconfiguration, default true. | true | |
max-inbound-message-size | org.springframework.util.unit.DataSize | The maximum message size allowed to be received on the server, default 4MB. @see GrpcUtil#DEFAULT_MAX_MESSAGE_SIZE | ||
max-inbound-metadata-size | org.springframework.util.unit.DataSize | The maximum size of metadata allowed to be received, default 8KB. @see GrpcUtil#DEFAULT_MAX_HEADER_LIST_SIZE | ||
port | java.lang.Integer | gRPC server port, default 9090, 0 or negative numbers will use random port. | 9090 | |
shutdown-timeout | java.lang.Long | Graceful shutdown timeout, default 30s, if 0 will wait forever util all active calls finished. | 30000 |
grpc.server.channelz
Class: grpcstarter.server.GrpcServerProperties$Channelz
Key | Type | Description | Default value | Deprecation |
---|---|---|---|---|
enabled | java.lang.Boolean | Whether to register {@link ChannelzService}, default false. | false | |
max-page-size | java.lang.Integer | The maximum page size to return, default 100. @see AdminInterface | 100 |
grpc.server.exception-handling
Class: grpcstarter.server.GrpcServerProperties$ExceptionHandling
Key | Type | Description | Default value | Deprecation |
---|---|---|---|---|
default-exception-advice-enabled | java.lang.Boolean | Whether to enable {@link DefaultGrpcExceptionAdvice}, default true. <p> {@link DefaultGrpcExceptionAdvice} will handle exceptions recognized by gRPC, including: </p> <ul> <li>{@link StatusRuntimeException}</li> <li>{@link StatusException}</li> </ul> <p> When enabled, you can directly throw {@link StatusRuntimeException} or {@link StatusException} in service implementation, and the exception will be handled by {@link DefaultGrpcExceptionAdvice}. </p> <pre>{@code @GrpcService public class SimpleService extends SimpleServiceGrpc.SimpleServiceImplBase { @Override public void unaryRpc(SimpleRequest request, StreamObserver<SimpleResponse> responseObserver) { throw new StatusRuntimeException(Status.INVALID_ARGUMENT.withDescription("Invalid request")); } } }</pre> @see DefaultGrpcExceptionAdvice @since 3.2.3 | true | |
enabled | java.lang.Boolean | Whether to enable exception handling, default true. | true |
grpc.server.health
Class: grpcstarter.server.GrpcServerProperties$Health
Key | Type | Description | Default value | Deprecation |
---|---|---|---|---|
enabled | java.lang.Boolean | Whether to enable health check, default false. | true |
grpc.server.in-process
Class: grpcstarter.server.GrpcServerProperties$InProcess
Key | Type | Description | Default value | Deprecation |
---|---|---|---|---|
name | java.lang.String | In-process server name, if configured, will create an in-process server, usually for testing. |
grpc.server.reflection
Class: grpcstarter.server.GrpcServerProperties$Reflection
Key | Type | Description | Default value | Deprecation |
---|---|---|---|---|
enabled | java.lang.Boolean | Whether to register reflection service, default false. | false |
grpc.server.response
Class: grpcstarter.server.GrpcServerProperties$Response
Key | Type | Description | Default value | Deprecation |
---|---|---|---|---|
max-description-length | java.lang.Integer | The maximum length of response description. <p> When the length of the description exceeds this value, it will be truncated. </p> @since 3.2.3 | 2048 |
grpc.server.tls
Class: grpcstarter.server.GrpcServerProperties$Tls
Key | Type | Description | Default value | Deprecation |
---|
grpc-metrics
grpc.metrics
Class: grpcstarter.extensions.metrics.GrpcMetricsProperties
Key | Type | Description | Default value | Deprecation |
---|---|---|---|---|
enabled | java.lang.Boolean | whether to enable metrics, default is {@code true} | true |
grpc.metrics.client
Class: grpcstarter.extensions.metrics.GrpcMetricsProperties$Client
Key | Type | Description | Default value | Deprecation |
---|---|---|---|---|
enabled | java.lang.Boolean | whether to enable client metrics, default is {@code true} | true | |
order | java.lang.Integer | The order of the client metrics interceptor. Default is {@code 0}. | 0 |
grpc.metrics.server
Class: grpcstarter.extensions.metrics.GrpcMetricsProperties$Server
Key | Type | Description | Default value | Deprecation |
---|---|---|---|---|
enabled | java.lang.Boolean | whether to enable server metrics, default is {@code true} | true | |
order | java.lang.Integer | The order of the server metrics interceptor. Default is {@code 0}. | 0 |
grpc-test
grpc.test
Class: grpcstarter.extensions.test.GrpcTestProperties
Key | Type | Description | Default value | Deprecation |
---|---|---|---|---|
enabled | java.lang.Boolean | Whether to enable test, default is {@code true}. | true |
grpc.test.server
Class: grpcstarter.extensions.test.GrpcTestProperties$Server
Key | Type | Description | Default value | Deprecation |
---|---|---|---|---|
enabled | java.lang.Boolean | Whether to enable test, default is {@code true}. | true | |
port-type | grpcstarter.extensions.test.GrpcTestProperties$PortType | Port configuration, default is {@link PortType#IN_PROCESS}, which means start grpc server with in-process transport. @see PortType |
grpc-tracing
grpc.tracing
Class: grpcstarter.extensions.tracing.GrpcTracingProperties
Key | Type | Description | Default value | Deprecation |
---|---|---|---|---|
enabled | java.lang.Boolean | whether to enable tracing, default is {@code true} | true |
grpc.tracing.client
Class: grpcstarter.extensions.tracing.GrpcTracingProperties$Client
Key | Type | Description | Default value | Deprecation |
---|---|---|---|---|
enabled | java.lang.Boolean | whether to enable client tracing, default is {@code true} | true | |
order | java.lang.Integer | The order of the client tracing interceptor. Default is {@code 0}. | 0 |
grpc.tracing.server
Class: grpcstarter.extensions.tracing.GrpcTracingProperties$Server
Key | Type | Description | Default value | Deprecation |
---|---|---|---|---|
enabled | java.lang.Boolean | whether to enable server tracing, default is {@code true} | true | |
order | java.lang.Integer | The order of the server tracing interceptor. Default is {@code 0}. | 0 |
grpc-transcoding
grpc.transcoding
Class: grpcstarter.extensions.transcoding.GrpcTranscodingProperties
Key | Type | Description | Default value | Deprecation |
---|---|---|---|---|
auto-mapping | java.lang.Boolean | Whether to route methods without the `google.api.http` option, default true. <p> Example: <pre>{@code package bookstore; service Bookstore { rpc GetShelf(GetShelfRequest) returns (Shelf) {} } message GetShelfRequest { int64 shelf = 1; } message Shelf {} }</pre> <p> The client could `post` a json body `{"shelf": 1234}` with the path of `/bookstore.Bookstore/GetShelfRequest` to call `GetShelfRequest`. | true | |
enabled | java.lang.Boolean | Whether to enable transcoding autoconfiguration, default {@code true}. | true | |
endpoint | java.lang.String | gRPC server endpoint, if not set, will use {@code localhost:${grpc.server.port}}. <p> In most cases, do not need to set this property explicitly. |
grpc.transcoding.print-options
Class: grpcstarter.extensions.transcoding.GrpcTranscodingProperties$PrintOptions
Key | Type | Description | Default value | Deprecation |
---|---|---|---|---|
add-whitespace | java.lang.Boolean | Whether to add spaces, line breaks and indentation to make the JSON output easy to read. Defaults to false. | false | |
always-print-enums-as-ints | java.lang.Boolean | Whether to always print enums as ints. By default they are rendered as strings. Defaults to false. | false |
grpc-validation
grpc.validation
Class: grpcstarter.extensions.validation.GrpcValidationProperties
Key | Type | Description | Default value | Deprecation |
---|---|---|---|---|
backend | grpcstarter.extensions.validation.GrpcValidationProperties$Backend | Validation implementation. | ||
enabled | java.lang.Boolean | Whether to enable validation, default is {@code true}. | true |
grpc.validation.client
Class: grpcstarter.extensions.validation.GrpcValidationProperties$Client
Key | Type | Description | Default value | Deprecation |
---|---|---|---|---|
enabled | java.lang.Boolean | Whether to enable validation, default is {@code true}. | true | |
order | java.lang.Integer | Validating interceptor order, default is {@code 0}. | 0 |
grpc.validation.server
Class: grpcstarter.extensions.validation.GrpcValidationProperties$Server
Key | Type | Description | Default value | Deprecation |
---|---|---|---|---|
enabled | java.lang.Boolean | Whether to enable validation, default is {@code true}. | true | |
order | java.lang.Integer | Validating interceptor order, default is {@code 0}. | 0 |