camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "michael.esmann" <>
Subject Errorhandling in setProperty/script
Date Fri, 25 Sep 2015 12:57:35 GMT

I have a situation where I want to set some properties on my exchange, if it
is possible. But I dont want the exchange to fail, if the property is not
present. I have tried something like this:

    <from uri=.../>

        <setProperty propertyName="info.MyProperty">
            <javaScript>request.body.substring(25, 33)</javaScript>

    <to uri=.../>

where I do not want this exchange to fail, if the body is shorter than 32
characters. But it didn't work.
What is the best way to accomplish this? I would like to avoid using
"onException" handler or "errorHandler" because I am only interested in
ignoring script errors, but if its the only way I can do it then that would
be okay.

Any suggestions?


View this message in context:
Sent from the Camel - Users mailing list archive at

View raw message