The @Order
annotation is not detected when used inside a @Configuration
and hence the order is undefined (on my JRE the interceptor defined by the last factory method is executed first)
Example:
@Configuration
public class MyConfig{
@Bean
@Order(1) // Ignored
@GRpcGlobalInterceptor
public ServerInterceptor first(){
return new ServerInterceptor(){ ..} // Executed last
}
@Bean
@Order(2) // Ignored
@GRpcGlobalInterceptor
public ServerInterceptor last(){
return new ServerInterceptor(){ ..} // Executed first
}
}