[
https://issues.apache.org/jira/browse/CAMEL-17443?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17471227#comment-17471227
]
Yasser Zamani commented on CAMEL-17443:
---------------------------------------
{quote}You can implement the min predicate logic in the file filter, eg get the
age of the file and then return true | false whether its accepted or not. Then
you do not have to use the filter EIP in the route.
{quote}
But once filtered for one time, Camel will never poll and try that file again,
right? If so then as said above, we don't want to skip those files, but we just
want to postpone them until they get a specified minimum age. Currently
{{.rollback()}} works perfectly - It aborts the exchange (i.e. won't move the
file to archive) and also will poll the file again and again. it doesn't skip
the file (as we want). This ticket wishes to make it possible to get same
behavior, but with no exception/rollback logs.
> .markRollbackOnly() doesn't abort exchange
> ------------------------------------------
>
> Key: CAMEL-17443
> URL: https://issues.apache.org/jira/browse/CAMEL-17443
> Project: Camel
> Issue Type: Wish
> Components: camel-core
> Affects Versions: 3.14.0
> Reporter: Yasser Zamani
> Priority: Major
> Fix For: 3.x
>
>
> {code:java}
> from("file:./target/source?move=../archive")
> .transacted()
> .choice().when(minAgePredicate).markRollbackOnly()
> .otherwise()
> ....
> {code}
> moves the consumed file to the archive folder even when it's marked to
> rollback!
> When I replace {{.markRollbackOnly()}} with {{.rollback()}}, it works as
> expected i.e. it doesn't move the file to the archive folder and polls it
> again and again until {{minAgePredicate}} satisfied. But the problem is that
> it logs a lot of warnings i.e. in each poll it warns about the rollback.
> As per docs, I wished I could ask Camel to just rollback and abort/stop
> exchange *silently* with *.markRollbackOnly()*.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)