Hi claus,
I tried implementing your logic and it is as follow:

public class MyCustomLoadBalancer extends SimpleLoadBalancerSupport 

{
        
public void process(Exchange exchange) throws Exception {
Processor target = chooseProcessor(exchange);
XPathBuilder sessionID =
XPathBuilder.xpath("substring(string(/*[local-name()='Envelope']/*[local-name()='Header']/*[local-name()='ReplyTo']/*[local-name()='ReferenceParameters']/*[local-name()='ServiceGroupId']/text()),
10)", String.class);
String session = sessionID.evaluate(exchange, String.class);
HashMap hm = new HashMap(); 
hm.put(getProcessors(),session);
target.process(exchange);
}

protected Processor chooseProcessor (Exchange exchange) throws Exception   
{
        Namespaces env = new Namespaces("soapenv",
"http://schemas.xmlsoap.org/soap/envelope/";);
        env.add("wsa", "http://www.w3.org/2005/08/addressing";);
        env.add("axis2", "http://ws.apache.org/namespaces/axis2";);

        Object expression = exchange.getIn().getHeader("test",
env.xpath("substring(string(/soapenv:Envelope/soapenv:Header/wsa:ReplyTo/wsa:ReferenceParameters/axis2:Serv‌
iceGroupId/text()), 10)", String.class));
        
        if (expression.equals() 
        
}
}

Now the problem is how can I call the hashmap object in my choose procesor
method? I cannot extend my choose processor method.

I am struck in the if part of the choose processor.

Could you please assist me in this?



--
View this message in context: 
http://camel.465427.n5.nabble.com/Using-a-custom-based-load-balancer-tp5719841p5719857.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to