Skip to content

Conversation

@therepanic
Copy link
Contributor

Remove the BindableService bean condition from gRPC health auto-configuration. Make server-side health opt-in by default spring.grpc.server.health.enabled=false. This allows exposing the health service as the only gRPC service without starting a server unexpectedly unless enabled.

Closes: gh-334

@therepanic
Copy link
Contributor Author

I will also add documentation where I will describe that server-side health in our case is disabled by default.

@onobc
Copy link
Contributor

onobc commented Dec 23, 2025

👋🏻 @therepanic , thanks for the quick turnaround. However, we would like to have a team chat about this change before proceeding. We will get back w/ you shortly.

@dsyer
Copy link
Member

dsyer commented Dec 23, 2025

It's more complicated than my comment in #334 implied. We don't want the health checks to be disabled by default if there actually is a BindableService. So we need a composite condition with split logic for when there is or isn't a BindableService registered.

@therepanic
Copy link
Contributor Author

therepanic commented Dec 23, 2025

You mean it should work like this?

  • If the application has at least one BindableService, then health should be enabled by default, as before.
  • If the BindableService bean isn't registered in the application, then it should be disabled by default and only enabled if we specify it in the config?

@dsyer
Copy link
Member

dsyer commented Dec 23, 2025

Precisely

@therepanic
Copy link
Contributor Author

Okay, I'll be back soon with some polished changes.

Enable gRPC health by default only when a BindableService is present.
Respect explicit spring.grpc.server.health.enabled overrides and add
tests.

Closes: spring-projectsgh-334

Signed-off-by: Andrey Litvitski <andrey1010102008@gmail.com>
@therepanic therepanic changed the title Allow gRPC health service without BindableService beans Refine default enablement of gRPC health service Dec 24, 2025
@therepanic
Copy link
Contributor Author

I've slightly reworked my changes. They now incorporate the logic described above. I've also documented it.

Document that server-side gRPC health is enabled by default only when a
BindableService is present.

Signed-off-by: Andrey Litvitski <andrey1010102008@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature Request: Enable gRPC Health service without BindableService beans

3 participants