- java.lang.Object
-
- io.helidon.grpc.server.GrpcServerConfiguration.Builder
-
- All Implemented Interfaces:
Builder<GrpcServerConfiguration>
,Supplier<GrpcServerConfiguration>
- Enclosing interface:
- GrpcServerConfiguration
public static final class GrpcServerConfiguration.Builder extends Object implements Builder<GrpcServerConfiguration>
AGrpcServerConfiguration
builder.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description GrpcServerConfiguration
build()
Build the instance from this builder.GrpcServerConfiguration.Builder
config(Config config)
Context
context()
GrpcServerConfiguration.Builder
context(Context context)
Configure the application scoped context to be used as a parent for webserver request contexts.GrpcServerConfiguration.Builder
maxRapidResets(int maxRapidResets)
Maximum number of rapid resets(stream RST sent by client before any data have been sent by server).GrpcServerConfiguration.Builder
name(String name)
Set the name of the gRPC server.GrpcServerConfiguration.Builder
port(int port)
Sets server port.GrpcServerConfiguration.Builder
rapidResetCheckPeriod(Duration rapidResetCheckPeriod)
Period for counting rapid resets(stream RST sent by client before any data have been sent by server).GrpcServerConfiguration.Builder
tlsConfig(GrpcTlsDescriptor tlsConfig)
Configures TLS configuration to use with the server socket.GrpcServerConfiguration.Builder
tracer(Tracer tracer)
Sets an opentracing.io tracer.GrpcServerConfiguration.Builder
tracer(Supplier<? extends Tracer> tracerBuilder)
Sets an opentracing.io tracer.GrpcServerConfiguration.Builder
tracingConfig(GrpcTracingConfig tracingConfig)
Set trace configuration.GrpcServerConfiguration.Builder
workersCount(int workers)
Sets a count of threads in pool used to process HTTP requests.
-
-
-
Method Detail
-
config
public GrpcServerConfiguration.Builder config(Config config)
-
name
public GrpcServerConfiguration.Builder name(String name)
Set the name of the gRPC server.Configuration key:
name
- Parameters:
name
- the name of the gRPC server- Returns:
- an updated builder
-
port
public GrpcServerConfiguration.Builder port(int port)
Sets server port. If port is0
or less then any available ephemeral port will be used.Configuration key:
port
- Parameters:
port
- the server port- Returns:
- an updated builder
-
rapidResetCheckPeriod
public GrpcServerConfiguration.Builder rapidResetCheckPeriod(Duration rapidResetCheckPeriod)
Period for counting rapid resets(stream RST sent by client before any data have been sent by server). Default value isPT30S
.- Parameters:
rapidResetCheckPeriod
- duration- Returns:
- updated builder
- See Also:
- ISO_8601 Durations,
maxRapidResets()
-
maxRapidResets
public GrpcServerConfiguration.Builder maxRapidResets(int maxRapidResets)
Maximum number of rapid resets(stream RST sent by client before any data have been sent by server). When reached withinrapidResetCheckPeriod()
, GOAWAY is sent to client and connection is closed. Default value is200
.- Parameters:
maxRapidResets
- maximum number of rapid resets- Returns:
- updated builder
- See Also:
rapidResetCheckPeriod()
-
context
public GrpcServerConfiguration.Builder context(Context context)
Configure the application scoped context to be used as a parent for webserver request contexts.- Parameters:
context
- top level context- Returns:
- an updated builder
-
tracer
public GrpcServerConfiguration.Builder tracer(Tracer tracer)
Sets an opentracing.io tracer. (Default isGlobalTracer
.)- Parameters:
tracer
- a tracer to set- Returns:
- an updated builder
-
tracer
public GrpcServerConfiguration.Builder tracer(Supplier<? extends Tracer> tracerBuilder)
Sets an opentracing.io tracer. (Default isGlobalTracer
.)- Parameters:
tracerBuilder
- a tracer builder to set; will be built as a first step of this method execution- Returns:
- updated builder
-
tracingConfig
public GrpcServerConfiguration.Builder tracingConfig(GrpcTracingConfig tracingConfig)
Set trace configuration.- Parameters:
tracingConfig
- the tracing configuration to set- Returns:
- an updated builder
-
workersCount
public GrpcServerConfiguration.Builder workersCount(int workers)
Sets a count of threads in pool used to process HTTP requests. Default value isCPU_COUNT * 2
.Configuration key:
workers
- Parameters:
workers
- a workers count- Returns:
- an updated builder
-
tlsConfig
public GrpcServerConfiguration.Builder tlsConfig(GrpcTlsDescriptor tlsConfig)
Configures TLS configuration to use with the server socket. If notnull
then the server enforces an TLS communication.- Parameters:
tlsConfig
- a TLS configuration to use- Returns:
- this builder
-
context
public Context context()
-
build
public GrpcServerConfiguration build()
Description copied from interface:Builder
Build the instance from this builder.- Specified by:
build
in interfaceBuilder<GrpcServerConfiguration>
- Returns:
- instance of the built type
-
-