Ordered interface not respected on non-singleton aspects [SPR-14959] #19526
Labels
in: core
Issues in core modules (aop, beans, core, context, expression)
type: enhancement
A general enhancement
Ken DeLong opened SPR-14959 and commented
I am using Java 8, Boot 1.4.1, and Spring 4.3.3 (from Boot).
I have a set of aspects that I instantiate as prototype scope, because they maintain state (like a CircuitBreaker) and they are individually exported to JMX for monitoring purposes. https://github.com/kenwdelong/stability-utils
The interceptors under consideration are:
https://github.com/kenwdelong/stability-utils/blob/stability-utils-1.3.10/src/main/java/com/kendelong/util/circuitbreaker/CircuitBreakerAspect.javahttps://github.com/kenwdelong/stability-utils/blob/stability-utils-1.3.10/src/main/java/com/kendelong/util/concurrency/ConcurrencyLimitingAspect.java
https://github.com/kenwdelong/stability-utils/blob/stability-utils-1.3.10/src/main/java/com/kendelong/util/performance/PerformanceMonitoringAspect.java
https://github.com/kenwdelong/stability-utils/blob/stability-utils-1.3.10/src/main/java/com/kendelong/util/retry/RetryInterceptor.java
The ordering of these interceptors is critical (and also the ordering relative to TransactionInterceptor and MethodSecurityInterceptor). However, the Ordered interface is not being respected here. My configuration (XML here, but JavaConfig behaves the same) is
{code:html/xml}
<bean class="com.kendelong.util.circuitbreaker.CircuitBreakerAspect" scope="prototype">
<property name="graphiteClient" ref="graphiteClient"/>
<property name="order" value="100" />
</bean>
Affects: 4.3.3
Reference URL: http://stackoverflow.com/questions/40768177/spring-aop-prototype-scoped-aspects-are-firing-out-of-order
Issue Links:
The text was updated successfully, but these errors were encountered: