-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Can't use GlobalInterceptor gRPC annotation with interceptor produced by a method #21358
Comments
@vladykin Thank you for your report! A workaround, if you cannot add a scope-defining annotation on the interceptor class, would be to subclass it and add the annotations on the subclass: @ApplicationScoped
@GlobalInterceptor
public class MyLoggingServerInterceptor extends LoggingServerInterceptor {
} |
I took a deeper look into it and it's not trivial to implement. |
Thank you, I can use the suggested workaround or put the CDI annotation directly on the LoggingServerInterceptor. |
I understand it's more convenient in some cases, I'm not closing this issue. |
I stumbled on this issue and I was wondering, would it be possible to use the |
Fixes quarkusio#21358 (cherry picked from commit e431054)
Describe the bug
I have a server interceptor produced by a method:
I want to make it global by putting io.quarkus.grpc.GlobalInterceptor annotation.
I can't put this annotation on the producer method, because the annotation has
@Target({ FIELD, PARAMETER, TYPE })
(not applicable to methods).And I can't put this annotation on LoggingServerInterceptor class, because the class does not have any CDI bean annotations on it. Quarkus complains:
Expected behavior
The GlobalInterceptor annotation should support this case as well.
Actual behavior
No response
How to Reproduce?
No response
Output of
uname -a
orver
No response
Output of
java -version
No response
GraalVM version (if different from Java)
No response
Quarkus version or git rev
2.4.1.Final
Build tool (ie. output of
mvnw --version
orgradlew --version
)No response
Additional information
No response
The text was updated successfully, but these errors were encountered: