camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From 孙 <sunchao...@126.com>
Subject Camel S3 Issue - Loop for ever
Date Mon, 05 Dec 2016 03:15:18 GMT
Hello, 


I am using Camel S3 as a consumer to consume files which were stored in AWS S3 Server , But
When I start the route ,it will always execute even I  added "deleteAfterRead" option , then
it will raise an exception, because there is no file left.  


Source code like this:



from("aws-s3:csun-bucket-test" + "?amazonS3Client=#cAWSS3_cAWSConnection_1" + "&fileName=abcd.txt")

.routeId("s3consumer_cAWSS3_1").process(new org.apache.camel.Processor() {

publicvoid process(org.apache.camel.Exchange exchange) throws Exception {




BufferedReader br = new BufferedReader(

new InputStreamReader((InputStream) exchange.getIn().getBody()));

System.out.println("FileName: " + exchange.getIn().getHeader("CamelAwsS3Key") + " Content:
"

+ br.readLine());

br.close();




}




}).id("s3consumer_cProcessor_1").to("log:s3consumer.cLog_1" + "?level=WARN")




.id("s3consumer_cLog_1");







Is it normal or it is a bug ? 




Thanks.

Billy.


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message