camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Müller (JIRA) <>
Subject [jira] [Commented] (CAMEL-7492) xpath/xquery - Allow to suppress exceptions when used as predicate
Date Wed, 11 Jun 2014 20:52:02 GMT


Christian Müller commented on CAMEL-7492:

Why not simply:
    <to uri="jms:fooOrBar"/>

I think it's because of the backwards compatibility, but is there a real use case where the
user would like to receive the exception instead of true/false?

May be we should introduce the change in the behavior (being not backwards compatible) but
providing a better default behavior.

> xpath/xquery - Allow to suppress exceptions when used as predicate
> ------------------------------------------------------------------
>                 Key: CAMEL-7492
>                 URL:
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-core, camel-saxon
>            Reporter: Claus Ibsen
>            Priority: Minor
>             Fix For: Future
> See
> If you use a content based router, and have different kind of xml coming in, you may
want to ignore any exceptions, if a < xpath > expression fails to evaluate as the xml
does not fit that format.
> So if we have
> {code}
>    <xpath ignoreException="true">/foo/bar</xpath>
> {code}
> eg a new attribute to set a flag to ignore exceptions. Though naming is hard, so maybe
there is a better name for the attribute.
> Related is also the validate eip, but I dont think we can use that as an expression/predicate:
> Otherwise we could do something like this; which may be even better as then it works
with any Camel expression/predicate. 
> {code:xml}
> <choice>
>    <when><validate><xpath>/foo/bar</xpath></validate>
>      <to uri="jms:fooOrBar"/>
>   </when>
>   ...
> {code}

This message was sent by Atlassian JIRA

View raw message