- java.lang.Object
-
- io.helidon.grpc.server.GrpcServerBasicConfig
-
- All Implemented Interfaces:
GrpcServerConfiguration
public class GrpcServerBasicConfig extends Object implements GrpcServerConfiguration
Configuration class for theGrpcServer
implementations.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface io.helidon.grpc.server.GrpcServerConfiguration
GrpcServerConfiguration.Builder
-
-
Field Summary
-
Fields inherited from interface io.helidon.grpc.server.GrpcServerConfiguration
DEFAULT_NAME, DEFAULT_PORT, DEFAULT_WORKER_COUNT
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Context
context()
The top levelContext
to be used by the server.int
maxRapidResets()
Returns the maximum allowed number of rapid resets (stream RST sent by client before any data have been sent by server).String
name()
Get the server name.int
port()
Get the server port.Duration
rapidResetCheckPeriod()
Returns the period for counting rapid resets (stream RST sent by client before any data have been sent by server).GrpcTlsDescriptor
tlsConfig()
Returns a SslConfiguration to use with the server socket.Tracer
tracer()
Returns an opentracing.io tracer.GrpcTracingConfig
tracingConfig()
Returns tracing configuration.boolean
useNativeTransport()
Determine whether use native transport if possible.int
workers()
Returns a count of threads in s pool used to process gRPC requests.
-
-
-
Method Detail
-
name
public String name()
Get the server name.- Specified by:
name
in interfaceGrpcServerConfiguration
- Returns:
- the server name
-
port
public int port()
Get the server port.- Specified by:
port
in interfaceGrpcServerConfiguration
- Returns:
- the server port
-
context
public Context context()
Description copied from interface:GrpcServerConfiguration
The top levelContext
to be used by the server.- Specified by:
context
in interfaceGrpcServerConfiguration
- Returns:
- a context instance with registered application scoped instances
-
useNativeTransport
public boolean useNativeTransport()
Determine whether use native transport if possible.If native transport support is enabled, gRPC server will use epoll on Linux, or kqueue on OS X. Otherwise, the standard NIO transport will be used.
- Specified by:
useNativeTransport
in interfaceGrpcServerConfiguration
- Returns:
true
if native transport should be used
-
tracer
public Tracer tracer()
Description copied from interface:GrpcServerConfiguration
Returns an opentracing.io tracer. Default isGlobalTracer
.- Specified by:
tracer
in interfaceGrpcServerConfiguration
- Returns:
- a tracer to use - never
null
(defaulting toGlobalTracer
-
tracingConfig
public GrpcTracingConfig tracingConfig()
Description copied from interface:GrpcServerConfiguration
Returns tracing configuration.- Specified by:
tracingConfig
in interfaceGrpcServerConfiguration
- Returns:
- a tracing configuration.
-
workers
public int workers()
Description copied from interface:GrpcServerConfiguration
Returns a count of threads in s pool used to process gRPC requests.Default value is
CPU_COUNT * 2
.- Specified by:
workers
in interfaceGrpcServerConfiguration
- Returns:
- a workers count
-
tlsConfig
public GrpcTlsDescriptor tlsConfig()
Description copied from interface:GrpcServerConfiguration
Returns a SslConfiguration to use with the server socket. If notnull
then the server enforces an SSL communication.- Specified by:
tlsConfig
in interfaceGrpcServerConfiguration
- Returns:
- a TLS configuration to use
-
rapidResetCheckPeriod
public Duration rapidResetCheckPeriod()
Description copied from interface:GrpcServerConfiguration
Returns the period for counting rapid resets (stream RST sent by client before any data have been sent by server).- Specified by:
rapidResetCheckPeriod
in interfaceGrpcServerConfiguration
- Returns:
- the period for counting rapid resets
-
maxRapidResets
public int maxRapidResets()
Description copied from interface:GrpcServerConfiguration
Returns the maximum allowed number of rapid resets (stream RST sent by client before any data have been sent by server). When reached withinGrpcServerConfiguration.rapidResetCheckPeriod()
, GOAWAY is sent to client and connection is closed.- Specified by:
maxRapidResets
in interfaceGrpcServerConfiguration
- Returns:
- the maximum allowed number of rapid resets
-
-