You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In our internal company library, we are using file resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports to declare Configurations which should be active for applications using it - similar to many other Spring Boot libraries.
In this configuration Order for ServerInterceptor with annotation @GRpcGlobalInterceptor is not working.
The problem is probably related to the fact, that with that configuration Spring Boot is using ASM-based classreader resulting with
SimpleMethodMetadata instead of reflection classreader with StandardMethodMetadata.
With such configuration Order for different Interceptors e.g. OncePerRequestFilter and WebFilter works correctly, but for GRpcGlobalInterceptor is not.
How to reproduce:
Modify your test grpc-spring-boot-starter-demo\src\test\java\org\lognet\springboot\grpc\OrderedInterceptorsTest.java which is working on Import.
Remove TheConfiguration.class from SpringBootTest to disable manual Import:
Expecting actual:
[]
to contain exactly (and in same order):
[1, 2, 3, 4, 5, 6, 7, 8, 10, 10, 100, 100]
Add file grpc-spring-boot-starter-demo\src\test\resources\META-INF\spring\org.springframework.boot.autoconfigure.AutoConfiguration.imports with content: org.lognet.springboot.grpc.OrderedInterceptorsTest.TheConfiguration to enable AutoConfiguration.
Result of the test - Order annotation is not working correctly:
In our internal company library, we are using file
resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
to declare Configurations which should be active for applications using it - similar to many other Spring Boot libraries.In this configuration Order for ServerInterceptor with annotation @GRpcGlobalInterceptor is not working.
The problem is probably related to the fact, that with that configuration Spring Boot is using ASM-based classreader resulting with
SimpleMethodMetadata instead of reflection classreader with StandardMethodMetadata.
With such configuration Order for different Interceptors e.g. OncePerRequestFilter and WebFilter works correctly, but for GRpcGlobalInterceptor is not.
How to reproduce:
Modify your test
grpc-spring-boot-starter-demo\src\test\java\org\lognet\springboot\grpc\OrderedInterceptorsTest.java
which is working on Import.Now result should be:
grpc-spring-boot-starter-demo\src\test\resources\META-INF\spring\org.springframework.boot.autoconfigure.AutoConfiguration.imports
with content:org.lognet.springboot.grpc.OrderedInterceptorsTest.TheConfiguration
to enable AutoConfiguration.Result of the test - Order annotation is not working correctly:
The text was updated successfully, but these errors were encountered: