Skip to content

Instantly share code, notes, and snippets.

@zregvart
Created April 27, 2017 20:20
Show Gist options
  • Save zregvart/982ba400978349c1dd60412484d91038 to your computer and use it in GitHub Desktop.
Save zregvart/982ba400978349c1dd60412484d91038 to your computer and use it in GitHub Desktop.
class FileEnrichRoute extends RouteBuilder {
@Override
public void configure() throws Exception {
from("file:folder1").pollEnrich("file:folder2", new AggregationStrategy() {
public Exchange aggregate(Exchange original, Exchange resource) {
String originalBody = original.getIn().getBody(String.class);
String resourceBody = resource.getIn().getBody(String.class);
original.getIn().setBody(originalBody + " " + resourceBody);
return original;
}
}).log("Body: ${body}");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment