Xilai Dai created CAMEL-12252:

             Summary: Dynamic setting the DESTINATION_OVERRIDE_URL doesn't work 
on CXFRS producer
                 Key: CAMEL-12252
                 URL: https://issues.apache.org/jira/browse/CAMEL-12252
             Project: Camel
          Issue Type: Bug
          Components: camel-cxfrs
    Affects Versions: 2.20.2, 2.19.4, 2.18.5, 2.17.0
         Environment: Java 8
            Reporter: Xilai Dai

Given the sample MyProcessor, setting the DESTINATION_OVERRIDE_URL dynamically 
during the invoke:
public void process(Exchange exchange) throws Exception {
    String env = (String)exchange.getIn().getHeader("Environnement");
    if (env.equalsIgnoreCase("DEV")) {
    } else {

Given the sample Route:
        .process(new HeaderProcessor())
        .process(new MyProcessor())
        .setHeader(org.apache.camel.Exchange.HTTP_METHOD, constant("GET"))
        .setHeader(org.apache.camel.Exchange.HTTP_PATH, constant("/"))

Send request to cxfrs:bean:MyREST with different http header "dev", then the 
cxfrs:bean:restClient always make call to the last setting Address.

(Only it works as expected when setting maxClientCacheSize=0 on the 

There is no this issue on Camel 2.16.x, but start problem from Camel 2.17.x and 
later versions. Investigations show that the CxfRsEndpoint becoming Singleton 
after CAMEL-9628, that explain why the last Address setting always applied.

This message was sent by Atlassian JIRA

Reply via email to