Search code examples
spring-bootspring-annotations

Spring annotation @Order


spring boot annotation @order

The lower the number, the higher the precedence

If I use @Order(-1000), what's that means? extremely high ?


Solution

  • Yes, @Order(-1000) will give you a higher precedence than say @Order(-1) or @Order(1000).

    @Order(-2147483648) has the highest precedence.

    See more here https://docs.spring.io/spring/docs/current/javadoc-api/constant-values.html#org.springframework.core.Ordered.HIGHEST_PRECEDENCE