On Tue, Sep 25, 2012 at 3:18 PM, balkishore <balkishore.pan...@gmail.com> wrote: > Hi claus, > How will I add an processor onto the hash map? > Something like this yields me error > map.put(id , getProcessors()); >
No put the target processor (eg the result of chooseProcessor) map.put(id , target); > And also My code is as follow: > > public void process(Exchange exchange) throws Exception { > Processor target = chooseProcessor(exchange); > > if (exchange.hasOut()) > { > String body = exchange.getOut().getBody(String.class); > XPathBuilder sessionID = > XPathBuilder.xpath("/*[local-name()='Envelope']/*[local-name()='Header']/*[local-name()='ReplyTo']/*[local-name()='ReferenceParameters']/*[local-name()='ServiceGroupId']/text()", > String.class); > String id = sessionID.evaluate(exchange.getContext(), > body); > System.out.println("id is" +id); > map.put(id , getProcessors()); > > } > else{ > String body = exchange.getIn().getBody(String.class); > XPathBuilder sessionID = > XPathBuilder.xpath("/*[local-name()='Envelope']/*[local-name()='Header']/*[local-name()='ReplyTo']/*[local-name()='ReferenceParameters']/*[local-name()='ServiceGroupId']/text()", > String.class); > String id = sessionID.evaluate(exchange.getContext(), > body); > System.out.println("id is" +id); > map.put(id , getProcessors()); > } > > > target.process(exchange); > } > > Is the logic correct? Because I am still not able to figure out things and > joining the dots. I would really appreciate if you could tell me if the > logic is correct. > > > > -- > View this message in context: > http://camel.465427.n5.nabble.com/Using-a-custom-based-load-balancer-tp5719841p5719943.html > Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen ----------------- Red Hat, Inc. FuseSource is now part of Red Hat Email: cib...@redhat.com Web: http://fusesource.com Twitter: davsclaus Blog: http://davsclaus.com Author of Camel in Action: http://www.manning.com/ibsen