- 
                Notifications
    
You must be signed in to change notification settings  - Fork 41.6k
 
Add Spring gRPC support #47288
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
          
     Open
      
      
            onobc
  wants to merge
  22
  commits into
  spring-projects:main
  
    
      
        
          
  
    
      Choose a base branch
      
     
    
      
        
      
      
        
          
          
        
        
          
            
              
              
              
  
           
        
        
          
            
              
              
           
        
       
     
  
        
          
            
          
            
          
        
       
    
      
from
onobc:cbono-grpc-autoconfig-springgrpc-GH-234
  
      
      
   
  
    
  
  
  
 
  
      
    base: main
Could not load branches
            
              
  
    Branch not found: {{ refName }}
  
            
                
      Loading
              
            Could not load tags
            
            
              Nothing to show
            
              
  
            
                
      Loading
              
            Are you sure you want to change the base?
            Some commits from the old base branch may be removed from the timeline,
            and old review comments may become outdated.
          
          
                
     Open
            
            Add Spring gRPC support #47288
                    onobc
  wants to merge
  22
  commits into
  spring-projects:main
from
onobc:cbono-grpc-autoconfig-springgrpc-GH-234
  
      
      
   
              
            Conversation
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
    
              
                    onobc
  
              
              commented
              
                  
                    Sep 22, 2025 
                  
              
              
            
            
| exclude "smoketest/grpc/proto" | ||
| } | ||
| 
               | 
          ||
| // FIXME get from 'protobuf-java-version' from dep mgmt | 
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.
If I were doing this test outside of Spring Boot I would use dependencyManagement.importedProperties. I banged on this for at least an hour and cut my losses and figured the reviewer will know a simple way to do this.
a4e4d21    to
    76ac9fb      
    Compare
  
    
    
  onobc 
      referenced
      this pull request
        in philwebb/spring-boot
    
      Sep 24, 2025 
    
    
  
This commit introduces support for Spring gRPC by moving the autoconfiguration, test, and starter modules from Spring gRPC to Spring Boot (here). The relavant docs from Spring gRPC are not included in this commit and will be available in a subsequent commit. Signed-off-by: onobc <[email protected]>
Updates the following gRPC related library versions: - `grpc-bom` from `1.74.0` to `1.75.0` - `protobuf-bum` from `4.31.1` to `4.32.1` Signed-off-by: onobc <[email protected]>
This updates the gRPC Kotlin version from `1.4.3` to `1.5.0` Signed-off-by: onobc <[email protected]>
Updates the gRPC and protobuf versions in the gRPC smoke test: - `grpc-bom` from `1.74.0` to `1.75.0` - `protobuf-bum` from `4.31.1` to `4.32.1` Signed-off-by: onobc <[email protected]>
Uses `org.springframework.boot.EnvironmentPostProcessor` instead of the deprecated `org.springframework.boot.env.EnvironmentPostProcessor` key in `spring.factories` for the `spring-boot-grpc-server` module. Signed-off-by: onobc <[email protected]>
The config prop name was mismatched in the both the gRPC client and server modules additional-spring-configuration-metadata.json files. This makes them consistent using the singular form of the property `spring.grpc.(client|server).observation.enabled`. Signed-off-by: onobc <[email protected]>
Signed-off-by: onobc <[email protected]>
Moves the grpc test code into its own module (`spring-boot-grc-test`) due to the modularization of the test module. Signed-off-by: onobc <[email protected]>
32331a9    to
    a1c2b04      
    Compare
  
    Addresses the following: - nits - visibility (move to package protected etc..) - javadocs - make server properties anemic Does not cover the following points: - rename / restructure the ConditionalOn... for server - observation API verify/check on direction - security concerns (need more review but should be good the way it is) Signed-off-by: onobc <[email protected]>
Consolidate the conditional annotations into an aggregate that checks for server and service enabled as well as one that checks that Spring gRPC is on the classpath. Signed-off-by: onobc <[email protected]>
Signed-off-by: onobc <[email protected]>
Signed-off-by: onobc <[email protected]>
Collapses the GrpcCodecConfiguration into the parent package to avoid exposing it publicly. Signed-off-by: onobc <[email protected]>
Collapses the single bean registered by ClientInterceptorsConfiguration into the 2 usages to avoid a public configuration class. Signed-off-by: onobc <[email protected]>
Signed-off-by: onobc <[email protected]>
Signed-off-by: onobc <[email protected]>
Signed-off-by: onobc <[email protected]>
Signed-off-by: onobc <[email protected]>
Signed-off-by: onobc <[email protected]>
- only use default de/compressor registry when user provides no custom de/compressor - update tests accordingly Signed-off-by: onobc <[email protected]>
- only use default de/compressor registry when user provides no custom de/compressor - update tests accordingly Signed-off-by: onobc <[email protected]>
Signed-off-by: onobc <[email protected]>
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
      
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
Add Spring gRPC support
This commit introduces support for Spring gRPC by moving the autoconfiguration, test, and starter modules from Spring gRPC to Spring Boot (here).
Note
The relevant docs from Spring gRPC are not included in this proposal (will be in a subsequent PR).
Here is a list of things to consider adding after this proposal is merged:
TODOs
ConditionalOnGrpcServerEnavled(e.g. spring.grpc.server.(|reflection|health|observation).enabled@LocalGrpcPortServerPortInfoApplicationContextInitializerInProcessTransportContextCustomizerFactory@AutoConfigureInProcessTransportActuatorHealthAdapterTests. They are disabled becauseHealthDescriptoris now abstract and sealed and as such we are unable to mock it or create an actual instance asIndicatedHealthDescriptoris package-protected.