camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Glattfelder, Beat " <>
Subject Java DSL question
Date Wed, 21 May 2014 09:19:12 GMT
Hi Camel Riders

I am back with a simple question I found to tough to answer myself: How do I access the message
body in a typesafe manner like in the TODO comment below? Obviously implementing a processor
works fine, but make things harder to read.

Thanks for advising,

                    .to("sql:select * from cwd_user where active='T' and directory_id=76644354?dataSource=confDB")
                    // TODO: setHeader("uid", bodyAsType(Map.class).get("username"));
                    .process(new Processor() {

                                   public void process(Exchange exchange)
                                                                   throws Exception {
                                                   Message msg = exchange.getIn();
                                                   msg.setHeader("uid", msg.getBody(Map.class)
                                                   msg.setHeader(Exchange.HTTP_PATH, "avatar/"
+ msg.getBody(Map.class)


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message