camel-users mailing list archives

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

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:

<route>
    <from uri=.../>

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

    <to uri=.../>
</route>

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?

/Michael



--
View this message in context: http://camel.465427.n5.nabble.com/Errorhandling-in-setProperty-script-tp5771968.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Mime
View raw message