Created
April 27, 2017 20:20
-
-
Save zregvart/982ba400978349c1dd60412484d91038 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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