from("file:/home/philip/ga4gh_registration?move=archived")
.choice()
.when(header("CamelFileName").endsWith(".yml"))
.unmarshal()
.yaml(YAMLLibrary.SnakeYAML)
.process(new Processor() {
@Override
void process(Exchange exchange) throws Exception {
String filename = exchange.getIn().getHeader("CamelFileName")
logger.info("registerDataset: "+filename)
def yamlObj = exchange.getIn().body
logger.info("body="+yamlObj)
logger.info("datasetName="+yamlObj.datasetName)
}
})
.otherwise()
.log("Bad registration file: "+header("CamelFileName"))
.end()
References:
http://camel.apache.org/yaml-data-format.html
No comments:
Post a Comment