grpc-ecosystem / grpc-ecosystem/grpc-spring

"reflection API" not working

Open
#566 6 comments 0 reactions 1 assignee Claimed by @ST-DDT View on GitHub
documentation
Dominant language
Java
Stars
3.7k
Forks
858
PR merge metrics
No merged PRs in 30d

Description

**The context**

What do you wish to achieve?

use `reflection API` debug grpc-server

**The bug**

I checked `grpc.server.reflection-service-enabled`config is`true` also ​`@Bean @GrpcService protoReflectionService` from `net.devh.boot.grpc.server.autoconfigure.GrpcReflectionServiceAutoConfiguration` did worked.

but `net.devh.boot.grpc.server.service.AnnotationGrpcServiceDiscoverer#findGrpcServices()` line:55

```
Collection beanNames =
Arrays.asList(this.applicationContext.getBeanNamesForAnnotation(GrpcService.class));
```

is not get the bean `protoReflectionService`,look like `applicationContext.getBeanNamesForAnnotation` method can't get annotation on method `@Bean` ,only on class .

Steps to reproduce the behavior:
just use grpcurl command:
```shell
grpcurl --plaintext localhost:26680 list
Failed to list services: server does not support the reflection API
```

**The application's environment**

Which versions do you use?
* Spring (boot): 2.1.18.RELEASE
* grpc-java: 1.37.0
* grpc-spring-boot-starter: 2.12.0.RELEASE
* java: version + architecture (64bit?) jdk1.8 / 64bit

the feature `reflection API` is look like contributed by @ST-DDT ?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.