grpc-ecosystem / grpc-spring

Spring Boot starter module for gRPC framework.
https://grpc-ecosystem.github.io/grpc-spring/
Apache License 2.0
3.53k stars 829 forks source link

@GrpcAdvice for specific classes only #804

Open Aleksander-Dorkov opened 1 year ago

Aleksander-Dorkov commented 1 year ago

The context We want to have one @GrpcAdvice for one grpc endpoint.

The question Is it possible to have one @GrpcAdvice for one class that extends a grpc service public class GrpcBonusController extends BonusServiceGrpc.BonusServiceImplBase {}

Which versions do you use?

Additional information In spring-boot-starter-web we can do

@ControllerAdvice(annotations = PragmaticRestController.class)
public class PragmaticControllerAdvice {}

@PragmaticRestController
public class PragmaticController {}

and then this @ControllerAdvice will only listen for the @RestController that is annotated with this annotation.

Can we do the same here?

ST-DDT commented 1 year ago

Can we do the same here?

This is currently not supported, but planned for later.