camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <claus.ib...@gmail.com>
Subject Re: How to read header of type java Map in choice block
Date Thu, 19 Jan 2017 11:06:04 GMT
Look at simple
http://camel.apache.org/simple

On Thu, Jan 19, 2017 at 11:49 AM, santoshkeleti
<keleti.santhosh@gmail.com> wrote:
> hi All,
>
> I have a situation where i have a header of type Map. based on the value of
> key=3 i need to route the massage to different URIs.
> i.e.
> from("file:/home/santoshkeleti/Desktop/Camel/input?noop=true")
>   .to("http://"+conncterURL+"iso/parse?isoMsg="+iso).process(new Processor()
> {
>                         @Override
>                         public void process(Exchange exchange) throws Exception {
>                                 map=exchange.getIn().getBody(String.class);
>                                 exchange.getIn().setHeader("map", map);
>                 exchange.getIn().setHeader("isoMap", new
> GsonBuilder().create().fromJson(map, Map.class));
>                 }
>                 }).choice()
>                  .when(((Map)header("isoMap")).gety(3).equals("21300")
>
> .toD("http://localhost:8080/CBS/iso/fundTransferISO?isoMsgMap=${header.map}");
>
>
> But i am getting Error like can not cast valueBuilder to map.
>
> Please provide me a solution. please
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/How-to-read-header-of-type-java-Map-in-choice-block-tp5792774.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2

Mime
View raw message