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