Join GitHub today
Composite elements do not honour @Order annotations [BATCH-1385] #2196
It is currently not possible to force the execution order of elements (read listeners, write listeners, ...) using the
After some time wondering why this was the case, I found that it was perfectly working using the Ordered interface.
The problem lies in org.springframework.batch.core.listener.OrderedComposite.
<snippet from OrderedComposite>
This add method should probably do something like
With this change , the elements with the annotation will be put in the ordered set, and their order value will be properly taken into account (the ordered set relies on a correct AnnotationAwareOrderComparator)