You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by ychawla <pr...@yahoo.com> on 2014/06/17 23:27:29 UTC

Camel Filter Bean when return value is false

Hello All,
I have a bean that will return a boolean of true or false.  When the value
is false, I want to go in a camel filter.  Filter looks for 'true', like
below:

			<camel:filter>
				<camel:method bean="accessControlProcessor" method="authorize" />
				<camel:log message="access control returned true"/>
			</camel:filter>

However, when this method returns false, I want to do something specific
like

			<camel:filter> 
				<camel:method bean="accessControlProcessor" method="authorize" />

				<camel:log message="Not authorized"/>
                                <camel:stop/>
			</camel:filter>

I now I can set a header in my authorize method and run a camel choice on
that header. However, is there a way to do this using the simple language or
the content based router?  I would rather not disrupt the processor with
camel specific code.

Thanks,
Yogesh




--
View this message in context: http://camel.465427.n5.nabble.com/Camel-Filter-Bean-when-return-value-is-false-tp5752457.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel Filter Bean when return value is false

Posted by ychawla <pr...@yahoo.com>.
I can do this:

			<camel:choice>
				<camel:when>
					<camel:method bean="accessControlProcessor" method="authorize" />
					<camel:log message="access control returned true"/>
				</camel:when>
				<camel:otherwise>
					<camel:log message="access control returned false"/>
				</camel:otherwise>
			</camel:choice>

Thanks.



--
View this message in context: http://camel.465427.n5.nabble.com/Camel-Filter-Bean-when-return-value-is-false-tp5752457p5752458.html
Sent from the Camel - Users mailing list archive at Nabble.com.