in jpa-idempotent-repository/src/main/java/org/acme/jpa/idempotent/repository/ExampleHarnessRoutes.java [32:67]
public void configure() {
/**
* Generate some example input files
*/
from("timer:createExampleInputFiles?delay={{timer.delay}}&period={{timer.period}}&repeatCount={{timer.repeatCount}}")
/**
* Populate the content of each file with a series of odd numbers 1,3,1,5,1,7 Note that the value 1 is a
* doublon in the series, so some of the files have a duplicate content
*/
.setBody(e -> Integer.toString(++COUNT % 2 == 0 ? 1 : COUNT))
.log("-----------------------------------------------------------------")
.log("Creating an example input file with content ${body}")
/**
* Arbitrary delay to ensure logs are printed in human friendly order most of the time
*/
.delay(constant(1000))
/**
* Create the file with the generated content in the target/input-files folder
*/
.to("file:target/input-files");
/**
* Consume the incoming API calls.
*/
from("platform-http:/costly-api-call")
/**
* Delegate treatment to the bean named costlyApiService defined in CostlyApiService.java
*/
.bean("costlyApiService");
/**
* Creates a service that return the set of content that were already consumed.
*/
from("platform-http:/content-set")
.bean("costlyApiService", "getContentSet");
}