-
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
Allow fine-tuning of gRPC server underneath of GrpcContainer
#1510
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #1510 +/- ##
============================================
+ Coverage 89.68% 89.70% +0.01%
- Complexity 4902 4904 +2
============================================
Files 631 631
Lines 15305 15312 +7
Branches 883 884 +1
============================================
+ Hits 13726 13735 +9
+ Misses 1273 1271 -2
Partials 306 306 |
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.
LGTM, which one minor suggestion.
@DisplayName("configure underlying gRPC server") | ||
void configureUnderlyingGrpcServer() { | ||
var port = 1654; | ||
var service = CommandService |
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.
Can we have .newBuilder()
on the previous line, please?
Probably, we need to have a test fixture which would read something like CommandSerice.noOp()
or CommandService.servingNoCommands()
.
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.
I have refrained from creating a fully-fledged fixture set, as we only have such cases thrice in two different tests. But I have created a new Given...
on this matter.
This changeset is a port of #1454 to
master
.Disclaimer
Also, this is just a first of such "porting" PRs. To keep things going, we are going to use the current state of
core-java:master
, rather than wait until the whole machinery (ProtoData et al) unwinds in its full blossom. Therefore,config
, dependencies and stuff will NOT be updated in scope of "porting".What's Changed
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.