You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by JSmith <js...@gmail.com> on 2016/08/12 12:09:11 UTC

Triggering choice-when block when no Exchanges make it through

Hey all,

So I have a block of code set up in Spring that goes like:

		<route customId="true" id="fileRoute">
			<from uri="{{ftp.route}}&amp;filter=#FileFilter" />
			
			<process ref="fileProcessor" />
			
			<choice>
				<when>
					<simple>${headers.CamelBatchComplete} == true </simple>
					<bean ref="FileFilter" method="setTime"/>
				</when>
			</choice>
			<to uri="{{ftp.end.route}}"/>
		</route>


During the initial polling, a handful of files will be found but after the
Processor they all get dropped.  That breaks the block because the
CamelBatchComplete is set on the last Exchange, but there are no Exchanges
making it through (right?).

What could I do to trigger that "setTime" method?



--
View this message in context: http://camel.465427.n5.nabble.com/Triggering-choice-when-block-when-no-Exchanges-make-it-through-tp5786357.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Triggering choice-when block when no Exchanges make it through

Posted by Quinn Stevenson <qu...@pronoia-solutions.com>.
If any files are found, the processor and choice condition will be executed, so could the fileProcessor be messing with the headers?

Also, believe with this configuration that Camel will only set the CamelBatchComplete header to true on the last file it found during the last poll - is that what you’re after?

> On Aug 12, 2016, at 6:09 AM, JSmith <js...@gmail.com> wrote:
> 
> Hey all,
> 
> So I have a block of code set up in Spring that goes like:
> 
> 		<route customId="true" id="fileRoute">
> 			<from uri="{{ftp.route}}&amp;filter=#FileFilter" />
> 			
> 			<process ref="fileProcessor" />
> 			
> 			<choice>
> 				<when>
> 					<simple>${headers.CamelBatchComplete} == true </simple>
> 					<bean ref="FileFilter" method="setTime"/>
> 				</when>
> 			</choice>
> 			<to uri="{{ftp.end.route}}"/>
> 		</route>
> 
> 
> During the initial polling, a handful of files will be found but after the
> Processor they all get dropped.  That breaks the block because the
> CamelBatchComplete is set on the last Exchange, but there are no Exchanges
> making it through (right?).
> 
> What could I do to trigger that "setTime" method?
> 
> 
> 
> --
> View this message in context: http://camel.465427.n5.nabble.com/Triggering-choice-when-block-when-no-Exchanges-make-it-through-tp5786357.html
> Sent from the Camel - Users mailing list archive at Nabble.com.