Skip to content

Instantly share code, notes, and snippets.

@monkey-codes
Created May 24, 2018 03:41
Show Gist options
  • Select an option

  • Save monkey-codes/4099ea46447821840921e6b16bf46329 to your computer and use it in GitHub Desktop.

Select an option

Save monkey-codes/4099ea46447821840921e6b16bf46329 to your computer and use it in GitHub Desktop.
Sample configuration for single threaded decorator driven approach.
@Bean
Job singleThreadDecoratorDrivenJob(ItemReader reader, ItemProcessor processor,
ItemWriter writer, MetricRegistry metricRegistry,
HtmlReportJobExecutionListener htmlReportJobExecutionListener) {
def factory = new DecoratorFactory(metricRegistry)
jobBuilderFactory
.get("single.thread.decorator.driven.job")
.listener(JobListenerFactoryBean.getListener(factory))
.listener(htmlReportJobExecutionListener)
.start(
stepBuilderFactory.get("step1")
.chunk(10)
.faultTolerant().skip(Throwable).skipLimit(Integer.MAX_VALUE)
.reader(factory.metricReader(reader))
.processor(factory.metricProcessor(processor))
.writer(factory.metricWriter(writer))
.listener(factory as Object)
.build()
).build()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment