-
- All Known Implementing Classes:
GrpcServerBasicConfig
public interface GrpcServerConfiguration
The configuration for a gRPC server.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
GrpcServerConfiguration.Builder
AGrpcServerConfiguration
builder.
-
Field Summary
Fields Modifier and Type Field Description static String
DEFAULT_NAME
The default server name.static int
DEFAULT_PORT
The default grpc port.static int
DEFAULT_WORKER_COUNT
The default number of worker threads that will be used if not explicitly set.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static GrpcServerConfiguration.Builder
builder()
Creates new instance of aserver configuration builder
.static GrpcServerConfiguration.Builder
builder(Config config)
Creates new instance of aserver configuration builder
with defaults from external configuration source.Context
context()
The top levelContext
to be used by the server.static GrpcServerConfiguration
create()
Creates new instance with default values for all configuration properties.static GrpcServerConfiguration
create(Config config)
Creates new instance with values from external configuration.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.
-
-
-
Field Detail
-
DEFAULT_NAME
static final String DEFAULT_NAME
The default server name.- See Also:
- Constant Field Values
-
DEFAULT_PORT
static final int DEFAULT_PORT
The default grpc port.- See Also:
- Constant Field Values
-
DEFAULT_WORKER_COUNT
static final int DEFAULT_WORKER_COUNT
The default number of worker threads that will be used if not explicitly set.
-
-
Method Detail
-
name
String name()
Get the server name.- Returns:
- the server name
-
port
int port()
Get the server port.- Returns:
- the server port
-
context
Context context()
The top levelContext
to be used by the server.- Returns:
- a context instance with registered application scoped instances
-
useNativeTransport
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.
- Returns:
true
if native transport should be used
-
tracer
Tracer tracer()
Returns an opentracing.io tracer. Default isGlobalTracer
.- Returns:
- a tracer to use - never
null
(defaulting toGlobalTracer
-
tracingConfig
GrpcTracingConfig tracingConfig()
Returns tracing configuration.- Returns:
- a tracing configuration.
-
workers
int workers()
Returns a count of threads in s pool used to process gRPC requests.Default value is
CPU_COUNT * 2
.- Returns:
- a workers count
-
tlsConfig
GrpcTlsDescriptor tlsConfig()
Returns a SslConfiguration to use with the server socket. If notnull
then the server enforces an SSL communication.- Returns:
- a TLS configuration to use
-
rapidResetCheckPeriod
Duration rapidResetCheckPeriod()
Returns the period for counting rapid resets (stream RST sent by client before any data have been sent by server).- Returns:
- the period for counting rapid resets
-
maxRapidResets
int maxRapidResets()
Returns the maximum allowed 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.- Returns:
- the maximum allowed number of rapid resets
-
create
static GrpcServerConfiguration create()
Creates new instance with default values for all configuration properties.- Returns:
- a new instance
-
create
static GrpcServerConfiguration create(Config config)
Creates new instance with values from external configuration.- Parameters:
config
- the externalized configuration- Returns:
- a new instance
-
builder
static GrpcServerConfiguration.Builder builder()
Creates new instance of aserver configuration builder
.- Returns:
- a new builder instance
-
builder
static GrpcServerConfiguration.Builder builder(Config config)
Creates new instance of aserver configuration builder
with defaults from external configuration source.- Parameters:
config
- the externalized configuration- Returns:
- a new builder instance
-
-