You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by 孙 <su...@126.com> on 2016/12/05 03:15:18 UTC

Camel S3 Issue - Loop for ever

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.



Re:Re: Camel S3 Issue - Loop for ever

Posted by 孙 <su...@126.com>.
Hello , Willem, Thanks for your reply, I am using camel 2.17.3 , My problem is, when I start the route using s3 , it will loop for ever (it will consume the same file again and again),  is it normal ? or is it a bug ?


Thanks Billy.





At 2016-12-05 12:57:53, "Willem Jiang" <wi...@gmail.com> wrote:
>Hi,
>
>Which version of Camel are you using?
>There are some JIRAs[1][2] may relate to the problem.
>
>[1]https://issues.apache.org/jira/browse/CAMEL-8431
>[2]https://issues.apache.org/jira/browse/CAMEL-9784
>
>
>
>Willem Jiang
>
>Blog: http://willemjiang.blogspot.com (English)
>          http://jnn.iteye.com  (Chinese)
>Twitter: willemjiang
>Weibo: 姜宁willem
>
>On Mon, Dec 5, 2016 at 11:15 AM, 孙 <su...@126.com> wrote:
>
>> 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.
>>
>>
>>

Re: Camel S3 Issue - Loop for ever

Posted by Willem Jiang <wi...@gmail.com>.
Hi,

Which version of Camel are you using?
There are some JIRAs[1][2] may relate to the problem.

[1]https://issues.apache.org/jira/browse/CAMEL-8431
[2]https://issues.apache.org/jira/browse/CAMEL-9784



Willem Jiang

Blog: http://willemjiang.blogspot.com (English)
          http://jnn.iteye.com  (Chinese)
Twitter: willemjiang
Weibo: 姜宁willem

On Mon, Dec 5, 2016 at 11:15 AM, 孙 <su...@126.com> wrote:

> 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.
>
>
>