From issues-return-49361-archive-asf-public=cust-asf.ponee.io@camel.apache.org Sat Feb 10 07:48:09 2018 Return-Path: X-Original-To: archive-asf-public@eu.ponee.io Delivered-To: archive-asf-public@eu.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by mx-eu-01.ponee.io (Postfix) with ESMTP id 47E6D18061A for ; Sat, 10 Feb 2018 07:48:09 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 382D3160C5F; Sat, 10 Feb 2018 06:48:09 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 8B289160C4D for ; Sat, 10 Feb 2018 07:48:08 +0100 (CET) Received: (qmail 45164 invoked by uid 500); 10 Feb 2018 06:48:07 -0000 Mailing-List: contact issues-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@camel.apache.org Delivered-To: mailing list issues@camel.apache.org Received: (qmail 45155 invoked by uid 99); 10 Feb 2018 06:48:07 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 10 Feb 2018 06:48:07 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 343E3180256 for ; Sat, 10 Feb 2018 06:48:06 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -109.511 X-Spam-Level: X-Spam-Status: No, score=-109.511 tagged_above=-999 required=6.31 tests=[ENV_AND_HDR_SPF_MATCH=-0.5, KAM_ASCII_DIVIDERS=0.8, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01, USER_IN_DEF_SPF_WL=-7.5, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id ch_rhPuHI5j2 for ; Sat, 10 Feb 2018 06:48:01 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 480BB5F124 for ; Sat, 10 Feb 2018 06:48:01 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id C6818E002F for ; Sat, 10 Feb 2018 06:48:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 5D20321E84 for ; Sat, 10 Feb 2018 06:48:00 +0000 (UTC) Date: Sat, 10 Feb 2018 06:48:00 +0000 (UTC) From: "Xilai Dai (JIRA)" To: issues@camel.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CAMEL-12252) Dynamic setting the DESTINATION_OVERRIDE_URL doesn't work on CXFRS producer MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CAMEL-12252?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16359284#comment-16359284 ] Xilai Dai commented on CAMEL-12252: ----------------------------------- To fix it, the address has to be set on the JAXRSClientFactoryBean object of the ClientFactoryBeanCache of the CxfRsProducer, then even the Endpoint is Singleton, the Address still can be set dynamiclly. > 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.17.0, 2.18.5, 2.19.4, 2.20.2 > Environment: Java 8 > Reporter: Xilai Dai > Priority: Major > > Given the sample MyProcessor, setting the DESTINATION_OVERRIDE_URL dynamically during the invoke: > {code} > public void process(Exchange exchange) throws Exception { > String env = (String)exchange.getIn().getHeader("Environnement"); > if (env.equalsIgnoreCase("DEV")) { > exchange.getIn().setHeader(exchange.DESTINATION_OVERRIDE_URL, > "http://esbdev11.local:8080/server1/metaServlet"); > } else { > exchange.getIn().setHeader(exchange.DESTINATION_OVERRIDE_URL, > "http://esblab11.local:8080/server2/metaServlet"); > } > } > {code} > Given the sample Route: > {code} > from("cxfrs:bean:MyREST") > .process(new HeaderProcessor()) > .setHeader("Environnement") > .simple("${header.http_query[env][0]}") > .process(new MyProcessor()) > .setHeader(org.apache.camel.Exchange.HTTP_METHOD, constant("GET")) > .setHeader(org.apache.camel.Exchange.ACCEPT_CONTENT_TYPE, constant("*/*")) > .setHeader(org.apache.camel.Exchange.HTTP_PATH, constant("/")) > .to("cxfrs:bean:restClient?maxClientCacheSize=5"); > {code} > 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 cxfrs:bean:restClient) > 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 (v7.6.3#76005)