File tree Expand file tree Collapse file tree 3 files changed +16
-3
lines changed
spring-grpc-spring-boot-autoconfigure/src/main/java/org/springframework/grpc/autoconfigure/server Expand file tree Collapse file tree 3 files changed +16
-3
lines changed Original file line number Diff line number Diff line change 6161 <groupId >io.grpc</groupId >
6262 <artifactId >grpc-servlet-jakarta</artifactId >
6363 </dependency >
64+ <dependency >
65+ <groupId >org.springframework.boot</groupId >
66+ <artifactId >spring-boot-starter-actuator</artifactId >
67+ </dependency >
68+ <dependency >
69+ <groupId >io.micrometer</groupId >
70+ <artifactId >micrometer-tracing-bridge-otel</artifactId >
71+ </dependency >
6472
6573 <dependency >
6674 <groupId >org.springframework.boot</groupId >
Original file line number Diff line number Diff line change 11spring.application.name =grpc-tomcat
22server.port =9090
3- server.http2.enabled =true
3+ server.http2.enabled =true
4+ logging.pattern.level =%5p [${spring.application.name:},%X{traceId:-},%X{spanId:-}]
5+ management.endpoints.web.exposure.include =*
Original file line number Diff line number Diff line change 3131import org .springframework .context .annotation .Configuration ;
3232import org .springframework .context .annotation .Import ;
3333import org .springframework .core .Ordered ;
34+ import org .springframework .grpc .server .GrpcServiceDiscoverer ;
3435import org .springframework .util .unit .DataSize ;
3536
3637import io .grpc .BindableService ;
38+ import io .grpc .ServerServiceDefinition ;
3739import io .grpc .servlet .jakarta .GrpcServlet ;
3840import io .grpc .servlet .jakarta .ServletServerBuilder ;
3941
@@ -67,9 +69,10 @@ static class GrpcServletConfiguration {
6769
6870 @ Bean
6971 public ServletRegistrationBean <GrpcServlet > grpcServlet (GrpcServerProperties properties ,
70- List <BindableService > services , ServerBuilderCustomizers serverBuilderCustomizers ) {
72+ GrpcServiceDiscoverer discoverer , ServerBuilderCustomizers serverBuilderCustomizers ) {
73+ List <ServerServiceDefinition > services = discoverer .findServices ();
7174 List <String > paths = services .stream ()
72- .map (service -> "/" + service .bindService (). getServiceDescriptor ().getName () + "/*" )
75+ .map (service -> "/" + service .getServiceDescriptor ().getName () + "/*" )
7376 .collect (Collectors .toList ());
7477 ServletServerBuilder servletServerBuilder = new ServletServerBuilder ();
7578 services .forEach (servletServerBuilder ::addService );
You can’t perform that action at this time.
0 commit comments