mercredi 4 mars 2015

Spring batch fault tolerant partitioning step

We have partitioned step which is calling soap server, fetching some styles and splitting those styles in slave steps (one style is one slave step).


Soap communication can fail in partitioner and we would like to give it 3 times to try until whole partitioner step fails. We are using java configuration like this:



private Step partitioningStep() {
return stepBuilderFactory.get("partitionedStyleLoadStep")
.partitioner("styleItemToArticle", stylePartitioner).step(styleItemToArticleStep())
.aggregator(styleAggregator)
.taskExecutor(styleLoadTaskExecutor()).gridSize(gridSize).allowStartIfComplete(true).build();
}


When we create regular steps with StepBuilderFactory after call to chunk we get SimpleStepBuilder which has faultTolerant() method (this allows setting step retry policy and other useful stuff). However on partitioned step after calling partitioner() method PartitionedStepBuilder is returned which does not have faultTolerant() method.


Any ideas how to achieve retry of master partitioned step easily in this setup?


Aucun commentaire:

Enregistrer un commentaire