Hello,
I don't think there is a need to concatenate like that (header. + " ... ").
In my experience with using simples in log messages you can just write:
"Client config not found for id ${header.myHeader}."
Or you could check out the docs below:
http://camel.apache.org/simple.html
On Tue, Aug 20, 2013 at 6:42 AM, abdiels <[email protected]> wrote:
> Hello,
>
> I am trying to print the client id on a exception message like this:
>
> from("seda:AddDataToCache").routeId("AddDataToCache")
> .threads()
> .choice()
> .when(header("CamelJdbcRowCount").isEqualTo(0))
> .log("No database record")
> .throwException(new
> ConfigurationNotFoundException("Client Configuration not found for
> clientid:
> ${header." + FMSHeaders.CLIENT_ID + "}"))
> .otherwise()
> .log("FOUND database record")
> .end()
> ;
>
> Now that of course does not work since we are passing a string to a
> constructor and the simple language will not kick in...I tried this
>
> new ConfigurationNotFoundException((new SimpleBuilder(
> "Client Configuration not found for clientid:
> ${header." + FMSHeaders.CLIENT_ID + "}")).evaluate(???,String.class))
>
> but I don't know how to get the exchange...Is there a way to accomplish
> putting this client id here? I know I can get in the error handler itself
> for example and I could do other things, but I am wondering if there is a
> way to just grab data like this from the message sort of mixing simple with
> strings. Please let me know your thoughts.
>
> Thank you,
>
> Abdiel
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Getting-a-Header-property-on-a-exception-in-the-DSL-tp5737551.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
--
Bart Horré
Anova r&d bvba