Java DSL - Let ValueBuilder be Predicate to make it easier to use predicates in
the Java DSL
--------------------------------------------------------------------------------------------
Key: CAMEL-5146
URL: https://issues.apache.org/jira/browse/CAMEL-5146
Project: Camel
Issue Type: Improvement
Components: camel-core
Reporter: Claus Ibsen
Assignee: Claus Ibsen
Fix For: 2.10.0
The Java DSL with the RouteBuilder has a number of built-in predicates and
expressions we use in the DSL. Such as with the CBR or Filter etc to define
predicates.
ValueBuilder contains many out of the box predicates for the DSL. We should let
it be predicate as well.
Then you can use compound predicates such as with not, to stack predicates
together:
{code}
from("direct:start")
.filter(not(header("foo")))
.to("mock:result");
{code}
Before this was not possible as header from ValueBuilder is only an expression.
And to fix that you would have to convert that to a predicate using a
toPredicate static method. Which makes the DSL more verbose and not as
stream-lined.
This causes a slight API change as we need to remove retryWhile(Expression) in
OnException as it has 2 methods to accept a predicate or expression. But in
reality we should only need the predicate, as that is what retryWhile is about.
This slight API change will break backwards compatibility (eg retryWhile in
OnException) so we will keep this on the 2.10 trunk.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira