I am new to Apache Camel. I want to access the data sent through a post request in order to download a file from S3. This is the router that I wrote.
public static class HelloRoute extends RouteBuilder {
@Override
public void configure() {
rest("/")
.post("file-from-s3")
.route()
.setHeader(AWS2S3Constants.KEY, constant("filename"))
.to("aws2-s3://bucketnameaccessKey=INSERT&secretKey=INSERT®ion=INSERT&operation=getObject")
.to("file:/tmp/")
.endRest();
}
The corresponding json data that will be sent ->
{
"filename" : "test.txt",
"bucketname": "testbucket",
"accessKey" : "key",
"secretKey" : "key2",
"region" : "region"
}
How to do I access these json values in the code above?