question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

@Order attribute on @GrpcGlobalInterceptor ignored when created by @Bean inside a @Configuration

See original GitHub issue

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
     }
 }

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:13

github_iconTop GitHub Comments

1reaction
jvmletcommented, Oct 22, 2020

I was dropped science 4.0.0

1reaction
seimecommented, Oct 22, 2020

Since I don’t want to drop support of 1.5.X

Spring Boot end of life was august 2019 - maybe it is time to drop support for it? https://spring.io/blog/2018/07/30/spring-boot-1-x-eol-aug-1st-2019

Read more comments on GitHub >

github_iconTop Results From Across the Web

Injecting ordered Beans into a Collection does not honour the ...
If I @Inject or pass these as a Collection<> they retain the order in which they were created, ignoring the @Order annotations. Is...
Read more >
24. Externalized Configuration - Spring
Spring Boot uses a very particular PropertySource order that is designed to allow sensible overriding of values. Properties are considered in the following ......
Read more >
Don't Use the @Profile Annotation in a Spring Boot App!
This configuration adds a bean of type MockService to the application context if the test profile is active, and a bean of type...
Read more >
Spring Boot Starter Module for GRPC Framework - Morioh
@Configuration public class MyConfig{ @Bean @GRpcGlobalInterceptor public ... This gives you the ability to set up the desired order of built-in and your ......
Read more >
The BeanDefinitionOverrideException in Spring Boot - Baeldung
It works by simply replacing the former bean in case of a name conflict. ... Let's create two different Spring configurations, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found