0
votes

I am trying to move from a commit interval to a custom completion policy.

My chunk tag is defined below.

<batch:chunk reader="x" writer="y" processor="z" skip-limit="100" chunk-completion-policy="myPolicy"> <batch:stream...> </batch:chunk>

<bean id="myPolicy" class="com.example.MyPolicy"/>

MyPolicy extends SimpleCompletionPolicy and implements CompletionPolicy. In the constructor of MyPolicy, if I add super(10) I expected to see the chunk size get set to 10. But when running the batch job this class is not recognized and the chunk size is set to 1. If I put printlns in the isComplete method nothing will be written out which leads me to believe I've configured my custom policy incorrectly.

Could someone please let me know if I missed a step in configuring a custom policy?

Thanks!

1
Nobody in community can help me configure a custom completion policy :( ? - Nomagon

1 Answers

0
votes

If you are using a version of spring batch older than 2.2.2, then it's known a bug; see Spring Batch - late binding of commit interval not working with skip policy