I'm trying to use the late binding on the commit-interval attribute of a chunk.
When the chunk doesn't contain a skip-policy or retry-policy, it works fine but as soon as a skip-policy is added (or even a retry-policy), the commit-interval is not taken into account and the batch works as if the commit-interval is set to 1. The weird thing is, when the commit-interval is hard coded, it works fine...
So this configuration works fine :
<chunk reader="multiAccuseReceptionItemReader"
processor="enrichissementPrescriptionItemProcessor"
writer="prescriptionItemWriter"
commit-interval="#{jobExecutionContext['commits']}">
This one works fine also :
<chunk reader="multiAccuseReceptionItemReader"
processor="enrichissementPrescriptionItemProcessor"
writer="prescriptionItemWriter"
skip-policy="skipPolicy"
commit-interval="3">
But this one doesn't take into account the commit-interval and set it to 1 :
<chunk reader="multiAccuseReceptionItemReader"
processor="enrichissementPrescriptionItemProcessor"
writer="prescriptionItemWriter"
skip-policy="skipPolicy"
commit-interval="#{jobExecutionContext['commits']}">
I tried to use completion-policy with the simpleCompletionPolicy instead of the commit-interval, but it's even worse : when there is a skip-policy or a retry-policy, the chunkSize is not taken into account, even if it is hard coded. Without any skip-policy or retry-policy the chunkSize is taken into account (hard coded or late binding).
I'm using Spring Batch 2.2.0 (and can't change).
Why this behavior? How can I dynamically set the commit-interval with a skip-policy and a retry-policy?