Skip to main content

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

Class: grpcstarter.client.GrpcClientProperties$Tls$KeyManager

KeyTypeDescriptionDefault valueDeprecation
cert-chainorg.springframework.core.io.Resource@see TlsChannelCredentials.Builder#getCertificateChain()
private-keyorg.springframework.core.io.Resource@see TlsChannelCredentials.Builder#getPrivateKey()
private-key-passwordjava.lang.String@see TlsChannelCredentials.Builder#getPrivateKeyPassword()

grpc.client.tls.trust-manager

Class: grpcstarter.client.GrpcClientProperties$Tls$TrustManager

KeyTypeDescriptionDefault valueDeprecation
root-certsorg.springframework.core.io.Resource@see TlsChannelCredentials.Builder#getRootCertificates()

grpc.client

Class: grpcstarter.client.GrpcClientProperties

KeyTypeDescriptionDefault valueDeprecation
authorityjava.lang.StringDefault authority. <p> e.g. localhost:8080 </p>
base-packagesjava.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>
channelsjava.util.List<grpcstarter.client.GrpcClientProperties$Channel>Channels configuration.
compressionjava.lang.StringCompression configuration. @see AbstractStub#withCompression(String)
deadlinejava.lang.LongDeadline after in milliseconds, default value is 5000. @see AbstractStub#withDeadline(Deadline) @since 3.2.0
enabledjava.lang.BooleanWhether to enable gRPC client autoconfiguration, default true.true
max-inbound-message-sizeorg.springframework.util.unit.DataSizeDefault max inbound message size, default value is 4MB. @see DataSize @see GrpcUtil#DEFAULT_MAX_MESSAGE_SIZE
max-inbound-metadata-sizeorg.springframework.util.unit.DataSizeDefault max metadata size, default value is 8KB. @see DataSize @see GrpcUtil#DEFAULT_MAX_HEADER_LIST_SIZE
max-outbound-message-sizeorg.springframework.util.unit.DataSizeDefault max outbound message size. @see DataSize @see AbstractStub#withMaxOutboundMessageSize(int)
metadatajava.util.List<grpcstarter.client.GrpcClientProperties$Metadata>Default metadata will be added to all the gRPC requests.
shutdown-timeoutjava.lang.LongChannel shutdown timeout in milliseconds, default value is 5000.5000
warn-unused-config-enabledjava.lang.BooleanWhether to enable warn unused config, default true.true

grpc.client.in-process

Class: grpcstarter.client.GrpcClientProperties$InProcess

KeyTypeDescriptionDefault valueDeprecation
namejava.lang.StringIn-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

KeyTypeDescriptionDefault valueDeprecation
enabledjava.lang.BooleanWhether 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

KeyTypeDescriptionDefault valueDeprecation
enabledjava.lang.BooleanWhether to enable retry. @see io.grpc.ManagedChannelBuilder#enableRetry() @see io.grpc.ManagedChannelBuilder#disableRetry()
max-retry-attemptsjava.lang.IntegerMaximum number of attempts to retry. @see io.grpc.ManagedChannelBuilder#maxRetryAttempts(int)
per-rpc-buffer-limitorg.springframework.util.unit.DataSizeThe maximum number of retry buffer entries per RPC. @see io.grpc.ManagedChannelBuilder#perRpcBufferLimit(long)
retry-buffer-sizeorg.springframework.util.unit.DataSizeThe maximum number of retry buffer entries. @see io.grpc.ManagedChannelBuilder#retryBufferSize(long)

grpc.client.tls

Class: grpcstarter.client.GrpcClientProperties$Tls

KeyTypeDescriptionDefault valueDeprecation

grpc-server-boot-autoconfigure

grpc.server.tls.key-manager

Class: grpcstarter.server.GrpcServerProperties$Tls$KeyManager

KeyTypeDescriptionDefault valueDeprecation
cert-chainorg.springframework.core.io.Resource@see TlsServerCredentials.Builder#getCertificateChain()
private-keyorg.springframework.core.io.Resource@see TlsServerCredentials.Builder#getPrivateKey()
private-key-passwordjava.lang.String@see TlsServerCredentials.Builder#getPrivateKeyPassword()

grpc.server.tls.trust-manager

Class: grpcstarter.server.GrpcServerProperties$Tls$TrustManager

KeyTypeDescriptionDefault valueDeprecation
root-certsorg.springframework.core.io.Resource@see TlsServerCredentials.Builder#getRootCertificates()

grpc.server.health.datasource

Class: grpcstarter.server.GrpcServerProperties$Health$DataSource

KeyTypeDescriptionDefault valueDeprecation
enabledjava.lang.BooleanWhether to enable datasource health check, default true.true
servicejava.lang.StringThe service name that will be used for datasource health check, default value is 'datasource'.datasource
timeoutjava.lang.Integer{@link #validationQuery} timeout, unit seconds.
validation-queryjava.lang.StringThe 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

KeyTypeDescriptionDefault valueDeprecation
enabledjava.lang.BooleanWhether to enable redis health check, default true.true
servicejava.lang.StringThe service name that will be used for redis health check, default value is 'redis'.redis

grpc.server

Class: grpcstarter.server.GrpcServerProperties

KeyTypeDescriptionDefault valueDeprecation
enable-empty-serverjava.lang.BooleanWhether to start a gRPC server when no service found, default true.true
enabledjava.lang.BooleanWhether to enable gRPC server autoconfiguration, default true.true
max-inbound-message-sizeorg.springframework.util.unit.DataSizeThe maximum message size allowed to be received on the server, default 4MB. @see GrpcUtil#DEFAULT_MAX_MESSAGE_SIZE
max-inbound-metadata-sizeorg.springframework.util.unit.DataSizeThe maximum size of metadata allowed to be received, default 8KB. @see GrpcUtil#DEFAULT_MAX_HEADER_LIST_SIZE
portjava.lang.IntegergRPC server port, default 9090, 0 or negative numbers will use random port.9090
shutdown-timeoutjava.lang.LongGraceful shutdown timeout, default 30s, if 0 will wait forever util all active calls finished.30000

grpc.server.channelz

Class: grpcstarter.server.GrpcServerProperties$Channelz

KeyTypeDescriptionDefault valueDeprecation
enabledjava.lang.BooleanWhether to register {@link ChannelzService}, default false.false
max-page-sizejava.lang.IntegerThe maximum page size to return, default 100. @see AdminInterface100

grpc.server.exception-handling

Class: grpcstarter.server.GrpcServerProperties$ExceptionHandling

KeyTypeDescriptionDefault valueDeprecation
default-exception-advice-enabledjava.lang.BooleanWhether 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.3true
enabledjava.lang.BooleanWhether to enable exception handling, default true.true

grpc.server.health

Class: grpcstarter.server.GrpcServerProperties$Health

KeyTypeDescriptionDefault valueDeprecation
enabledjava.lang.BooleanWhether to enable health check, default false.true

grpc.server.in-process

Class: grpcstarter.server.GrpcServerProperties$InProcess

KeyTypeDescriptionDefault valueDeprecation
namejava.lang.StringIn-process server name, if configured, will create an in-process server, usually for testing.

grpc.server.reflection

Class: grpcstarter.server.GrpcServerProperties$Reflection

KeyTypeDescriptionDefault valueDeprecation
enabledjava.lang.BooleanWhether to register reflection service, default false.false

grpc.server.response

Class: grpcstarter.server.GrpcServerProperties$Response

KeyTypeDescriptionDefault valueDeprecation
max-description-lengthjava.lang.IntegerThe maximum length of response description. <p> When the length of the description exceeds this value, it will be truncated. </p> @since 3.2.32048

grpc.server.tls

Class: grpcstarter.server.GrpcServerProperties$Tls

KeyTypeDescriptionDefault valueDeprecation

grpc-metrics

grpc.metrics

Class: grpcstarter.extensions.metrics.GrpcMetricsProperties

KeyTypeDescriptionDefault valueDeprecation
enabledjava.lang.Booleanwhether to enable metrics, default is {@code true}true

grpc.metrics.client

Class: grpcstarter.extensions.metrics.GrpcMetricsProperties$Client

KeyTypeDescriptionDefault valueDeprecation
enabledjava.lang.Booleanwhether to enable client metrics, default is {@code true}true
orderjava.lang.IntegerThe order of the client metrics interceptor. Default is {@code 0}.0

grpc.metrics.server

Class: grpcstarter.extensions.metrics.GrpcMetricsProperties$Server

KeyTypeDescriptionDefault valueDeprecation
enabledjava.lang.Booleanwhether to enable server metrics, default is {@code true}true
orderjava.lang.IntegerThe order of the server metrics interceptor. Default is {@code 0}.0

grpc-test

grpc.test

Class: grpcstarter.extensions.test.GrpcTestProperties

KeyTypeDescriptionDefault valueDeprecation
enabledjava.lang.BooleanWhether to enable test, default is {@code true}.true

grpc.test.server

Class: grpcstarter.extensions.test.GrpcTestProperties$Server

KeyTypeDescriptionDefault valueDeprecation
enabledjava.lang.BooleanWhether to enable test, default is {@code true}.true
port-typegrpcstarter.extensions.test.GrpcTestProperties$PortTypePort 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

KeyTypeDescriptionDefault valueDeprecation
enabledjava.lang.Booleanwhether to enable tracing, default is {@code true}true

grpc.tracing.client

Class: grpcstarter.extensions.tracing.GrpcTracingProperties$Client

KeyTypeDescriptionDefault valueDeprecation
enabledjava.lang.Booleanwhether to enable client tracing, default is {@code true}true
orderjava.lang.IntegerThe order of the client tracing interceptor. Default is {@code 0}.0

grpc.tracing.server

Class: grpcstarter.extensions.tracing.GrpcTracingProperties$Server

KeyTypeDescriptionDefault valueDeprecation
enabledjava.lang.Booleanwhether to enable server tracing, default is {@code true}true
orderjava.lang.IntegerThe order of the server tracing interceptor. Default is {@code 0}.0

grpc-transcoding

grpc.transcoding

Class: grpcstarter.extensions.transcoding.GrpcTranscodingProperties

KeyTypeDescriptionDefault valueDeprecation
auto-mappingjava.lang.BooleanWhether 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
enabledjava.lang.BooleanWhether to enable transcoding autoconfiguration, default {@code true}.true
endpointjava.lang.StringgRPC 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

KeyTypeDescriptionDefault valueDeprecation
add-whitespacejava.lang.BooleanWhether to add spaces, line breaks and indentation to make the JSON output easy to read. Defaults to false.false
always-print-enums-as-intsjava.lang.BooleanWhether 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

KeyTypeDescriptionDefault valueDeprecation
backendgrpcstarter.extensions.validation.GrpcValidationProperties$BackendValidation implementation.
enabledjava.lang.BooleanWhether to enable validation, default is {@code true}.true

grpc.validation.client

Class: grpcstarter.extensions.validation.GrpcValidationProperties$Client

KeyTypeDescriptionDefault valueDeprecation
enabledjava.lang.BooleanWhether to enable validation, default is {@code true}.true
orderjava.lang.IntegerValidating interceptor order, default is {@code 0}.0

grpc.validation.server

Class: grpcstarter.extensions.validation.GrpcValidationProperties$Server

KeyTypeDescriptionDefault valueDeprecation
enabledjava.lang.BooleanWhether to enable validation, default is {@code true}.true
orderjava.lang.IntegerValidating interceptor order, default is {@code 0}.0