camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Claus Ibsen (JIRA)" <j...@apache.org>
Subject [jira] Commented: (CAMEL-2241) PollingConsumer - Add option to decide when to let synchronizations be executed - onCompletion or afterConsume
Date Mon, 29 Mar 2010 11:25:08 GMT

    [ https://issues.apache.org/activemq/browse/CAMEL-2241?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=58533#action_58533
] 

Claus Ibsen commented on CAMEL-2241:
------------------------------------

PollingConsumer now handover completion to the Exchange so it works out of the box for FTP/File
components etc.

> PollingConsumer - Add option to decide when to let synchronizations be executed - onCompletion
or afterConsume
> --------------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-2241
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-2241
>             Project: Apache Camel
>          Issue Type: New Feature
>          Components: camel-core
>    Affects Versions: 2.0.0, 2.1.0
>            Reporter: Claus Ibsen
>            Assignee: Claus Ibsen
>            Priority: Minor
>             Fix For: 2.3.0
>
>
> This allows for example ftp / file polling consumers to move/delete files etc. right
after consuming instead of delegating that to the end.
> This can be needed when you work with these consumers manually in a java like code
> {code}
>         PollingConsumer consumer = context.getEndpoint(getFtpUrl()).createPollingConsumer();
>         consumer.start();
>         boolean done = false;
>         while (!done) {
>             Exchange exchange = consumer.receive(2000);
>             if (exchange == null) {
>                 done = true;
>                 break;
>             }
>             String body = exchange.getIn().getBody(String.class);
>             template.sendBody("mock:result", body);
>             ExchangeHelper.done(exchange);
>         }
>         consumer.stop();
> {code}
> The idea is to avoid the ExchangeHelper.done(exchange) by flipping a switch on the FTP
endpoint.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message