-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[1.x] Allow to configure the underlying gRPC server #1454
Conversation
…ng a `GrpcContainer`.
@dmdashenkov PTAL. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@armiol, LGTM but for a single naming suggestion.
.build(); | ||
GrpcContainer container = | ||
GrpcContainer.atPort(port) | ||
.apply((server) -> server.addService(service)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's make the naming a bit more precise.
GrpcContainer.atPort(port)
.withServer(s -> s.addService(service))
.build();
Method apply(..)
seems a bit too general. On another minor note, it's going to cause confusion on Kotlin and, probably, some extra syntax trickery to resolve the clash for the Kotlin compiler.
…l-style programming.
Prior to this changeset, there was no convenient way to set some "native" properties of the gRPC server, which is running underneath Spine's
GrpcContainer
.In particular, it is often needed to set the maximum size for the inbound messages. And it was nearly not possible to achieve, other than using a test-only
GrpcContainer.injectServer()
method. There is also a number of other configuration endpoints provided by the gRPC'sServerBuilder
, which could not be accessed.In this PR, the gRPC's
ServerBuilder
API becomes exposed like this:So, rather than copying the
ServerBuilder
's API inGrpcContainer
, the direct access to the builder is provided. That will allow to be always up-to-date with the configuration capabilities of the gRPCServer
, rather than copying and chasing their API in the gRPC releases to come.However, as of this PR, the
GrpcContainer.Builder.withServer(...)
method is marked as@Experimental
. The reason is that the "native"ServerBuilder
API allows to perform some destructive actions. Therefore, the decision to expose it as-is is not yet final.The library version is set to
1.8.2
. The release notes will follow.