[jira] [Commented] (CAMEL-12252) Dynamic setting the DESTINATION_OVERRIDE_URL doesn't work on CXFRS producer

2019-07-10 Thread Xilai Dai (JIRA)


[ 
https://issues.apache.org/jira/browse/CAMEL-12252?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16882598#comment-16882598
 ] 

Xilai Dai commented on CAMEL-12252:
---

[~nannou9], Could you please link to the separate issue if you created already?

> 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
>Assignee: Alex Dettinger
>Priority: Major
> Fix For: 2.20.3, 2.21.1, 2.22.0
>
>
> 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)


[jira] [Commented] (CAMEL-12252) Dynamic setting the DESTINATION_OVERRIDE_URL doesn't work on CXFRS producer

2019-03-19 Thread Piotr Klimczak (JIRA)


[ 
https://issues.apache.org/jira/browse/CAMEL-12252?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16795792#comment-16795792
 ] 

Piotr Klimczak commented on CAMEL-12252:


This change has introduced an inconsistency in the behaviour of Spring and 
Blueprint endpoints.
Also, Spring endpoint now ignores custom JAXRSClientFactoryBeans, correctly 
resolved by the CxfRsComponent.

Will raise separate issue.

> 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
>Assignee: Alex Dettinger
>Priority: Major
> Fix For: 2.20.3, 2.21.1, 2.22.0
>
>
> 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)


[jira] [Commented] (CAMEL-12252) Dynamic setting the DESTINATION_OVERRIDE_URL doesn't work on CXFRS producer

2018-03-18 Thread Alex Dettinger (JIRA)

[ 
https://issues.apache.org/jira/browse/CAMEL-12252?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16404217#comment-16404217
 ] 

Alex Dettinger commented on CAMEL-12252:


Backported to camel-2.21.x

> 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
>Assignee: Alex Dettinger
>Priority: Major
> Fix For: 2.22.0
>
>
> 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)


[jira] [Commented] (CAMEL-12252) Dynamic setting the DESTINATION_OVERRIDE_URL doesn't work on CXFRS producer

2018-03-17 Thread Xilai Dai (JIRA)

[ 
https://issues.apache.org/jira/browse/CAMEL-12252?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16403816#comment-16403816
 ] 

Xilai Dai commented on CAMEL-12252:
---

[~aldettinger] Could you please backport the fixes to the camel-2.21.x branch 
(or even earlier branches)?

> 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
>Assignee: Alex Dettinger
>Priority: Major
> Fix For: 2.22.0
>
>
> 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)


[jira] [Commented] (CAMEL-12252) Dynamic setting the DESTINATION_OVERRIDE_URL doesn't work on CXFRS producer

2018-03-17 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/CAMEL-12252?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16403672#comment-16403672
 ] 

ASF GitHub Bot commented on CAMEL-12252:


aldettinger commented on issue #2256: CAMEL-12252: Corrected a bug in the URL 
override mechanism
URL: https://github.com/apache/camel/pull/2256#issuecomment-373942167
 
 
   Thanks all. I've merged on master.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> 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
>Assignee: Alex Dettinger
>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)


[jira] [Commented] (CAMEL-12252) Dynamic setting the DESTINATION_OVERRIDE_URL doesn't work on CXFRS producer

2018-03-17 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/CAMEL-12252?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16403673#comment-16403673
 ] 

ASF GitHub Bot commented on CAMEL-12252:


aldettinger closed pull request #2256: CAMEL-12252: Corrected a bug in the URL 
override mechanism
URL: https://github.com/apache/camel/pull/2256
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git 
a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsSpringEndpoint.java
 
b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsSpringEndpoint.java
index fa96d3c874c..d10d6c52848 100644
--- 
a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsSpringEndpoint.java
+++ 
b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsSpringEndpoint.java
@@ -18,25 +18,31 @@
 package org.apache.camel.component.cxf.jaxrs;
 
 import org.apache.camel.Component;
+import org.apache.camel.component.cxf.spring.SpringJAXRSClientFactoryBean;
+import org.apache.camel.spring.SpringCamelContext;
+import org.apache.cxf.configuration.spring.ConfigurerImpl;
 import org.apache.cxf.jaxrs.AbstractJAXRSFactoryBean;
 import org.apache.cxf.jaxrs.JAXRSServerFactoryBean;
 import org.apache.cxf.jaxrs.client.JAXRSClientFactoryBean;
+import org.springframework.context.ApplicationContext;
 
 public class CxfRsSpringEndpoint extends CxfRsEndpoint implements BeanIdAware {
 private AbstractJAXRSFactoryBean bean;
+private ConfigurerImpl configurer;
 private String beanId;
-
-@Deprecated 
+
+@Deprecated
 /**
  * It will be removed in Camel 3.0
+ * 
  * @param comp
  * @param bean
  */
 public CxfRsSpringEndpoint(Component component, AbstractJAXRSFactoryBean 
bean) throws Exception {
-super(bean.getAddress(), component);
+super(bean.getAddress(), component);
 init(bean);
 }
-
+
 public CxfRsSpringEndpoint(Component component, String uri, 
AbstractJAXRSFactoryBean bean) throws Exception {
 super(uri, component);
 setAddress(bean.getAddress());
@@ -44,31 +50,40 @@ public CxfRsSpringEndpoint(Component component, String uri, 
AbstractJAXRSFactory
 bean.setAddress(getAddress());
 init(bean);
 }
-
+
 private void init(AbstractJAXRSFactoryBean bean) {
 this.bean = bean;
 if (bean instanceof BeanIdAware) {
 setBeanId(((BeanIdAware)bean).getBeanId());
 }
+
+ApplicationContext applicationContext = 
((SpringCamelContext)getCamelContext()).getApplicationContext();
+configurer = new ConfigurerImpl(applicationContext);
 }
-
+
 @Override
 protected JAXRSServerFactoryBean newJAXRSServerFactoryBean() {
 checkBeanType(bean, JAXRSServerFactoryBean.class);
 return (JAXRSServerFactoryBean)bean;
 }
-
+
 @Override
 protected JAXRSClientFactoryBean newJAXRSClientFactoryBean() {
-checkBeanType(bean, JAXRSClientFactoryBean.class);
-return (JAXRSClientFactoryBean)bean;
+return new SpringJAXRSClientFactoryBean();
 }
-
+
+@Override
+protected void setupJAXRSClientFactoryBean(JAXRSClientFactoryBean cfb, 
String address) {
+configurer.configureBean(beanId, cfb);
+cfb.setAddress(address);
+cfb.setThreadSafe(true);
+}
+
 public String getBeanId() {
 return beanId;
 }
-
-public void setBeanId(String id) {
+
+public void setBeanId(String id) {
 this.beanId = id;
 }
 }
diff --git 
a/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/jaxrs/CxfRsProducerAddressOverrideTest.java
 
b/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/jaxrs/CxfRsProducerAddressOverrideTest.java
index 4690778bcd2..9f9d5c360cf 100644
--- 
a/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/jaxrs/CxfRsProducerAddressOverrideTest.java
+++ 
b/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/jaxrs/CxfRsProducerAddressOverrideTest.java
@@ -30,7 +30,7 @@
 
 public class CxfRsProducerAddressOverrideTest extends CamelSpringTestSupport {
 private static int port1 = CXFTestSupport.getPort1();
-private static int port2 = 
CXFTestSupport.getPort("CxfRsProducerAddressOverrideTest.jetty"); 
+private static int port2 = 
CXFTestSupport.getPort("CxfRsProducerAddressOverrideTest.jetty");
 public int getPort1() {
 return port1;
 }
@@ -39,7 +39,7 @@ public int getPort2() {
 }
 
 @Override
-protected AbstractXmlApplicationContext createApplicationContext() {   
+protected AbstractXmlApplicationContext 

[jira] [Commented] (CAMEL-12252) Dynamic setting the DESTINATION_OVERRIDE_URL doesn't work on CXFRS producer

2018-03-17 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/CAMEL-12252?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16403674#comment-16403674
 ] 

ASF GitHub Bot commented on CAMEL-12252:


Github user aldettinger closed the pull request at:

https://github.com/apache/camel/pull/2256


> 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
>Assignee: Alex Dettinger
>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)


[jira] [Commented] (CAMEL-12252) Dynamic setting the DESTINATION_OVERRIDE_URL doesn't work on CXFRS producer

2018-03-17 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/CAMEL-12252?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16403569#comment-16403569
 ] 

ASF GitHub Bot commented on CAMEL-12252:


aldettinger closed pull request #2218: fix CAMEL-12252 and add test case for it
URL: https://github.com/apache/camel/pull/2218
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git 
a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsProducer.java
 
b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsProducer.java
index fa9978c71b3..b04a6a7be92 100644
--- 
a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsProducer.java
+++ 
b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsProducer.java
@@ -865,6 +865,7 @@ public JAXRSClientFactoryBean get(String address) throws 
Exception {
 LOG.trace("Created client factory bean and add to cache 
for address '{}'", address);
 
 } else {
+retVal.setAddress(address);
 LOG.trace("Retrieved client factory bean from cache for 
address '{}'", address);
 }
 }
diff --git 
a/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/jaxrs/CxfRsProducerAddressOverrideTest.java
 
b/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/jaxrs/CxfRsProducerAddressOverrideTest.java
index 4690778bcd2..9c5f0083e4b 100644
--- 
a/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/jaxrs/CxfRsProducerAddressOverrideTest.java
+++ 
b/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/jaxrs/CxfRsProducerAddressOverrideTest.java
@@ -149,4 +149,47 @@ public void process(Exchange exchange) throws Exception {
 assertEquals("Get a wrong customer id ", 123, response.getId());
 assertEquals("Get a wrong customer name", "John", response.getName());
 }
+
+@Test
+public void testAddressMultiOverride() {
+// First call with override url
+Exchange exchange = template.send("direct://http",
+new SendProcessor("http://localhost:; + getPort1() + 
"/CxfRsProducerAddressOverrideTest"));
+// get the response message
+Customer response = (Customer) exchange.getOut().getBody();
+assertNotNull("The response should not be null ", response);
+
+// Second call with override url
+exchange = template.send("direct://http",
+new SendProcessor("http://localhost:; + getPort1() + 
"/CxfRsProducerNonExistingAddressOverrideTest"));
+
+// Third call with override url
+exchange = template.send("direct://http",
+new SendProcessor("http://localhost:; + getPort1() + 
"/CxfRsProducerAddressOverrideTest"));
+// get the response message
+response = (Customer) exchange.getOut().getBody();
+assertNotNull("The response should not be null ", response);
+}
+
+class SendProcessor implements Processor {
+private String address;
+
+public SendProcessor(String address) {
+this.address = address;
+}
+public void process(Exchange exchange) throws Exception {
+exchange.setPattern(ExchangePattern.InOut);
+Message inMessage = exchange.getIn();
+
+// using the http central client API
+inMessage.setHeader(CxfConstants.CAMEL_CXF_RS_USING_HTTP_API, 
Boolean.TRUE);
+// set the Http method
+inMessage.setHeader(Exchange.HTTP_METHOD, "GET");
+// set the relative path
+inMessage.setHeader(Exchange.HTTP_PATH, 
"/customerservice/customers/123");
+// Specify the response class , cxfrs will use InputStream as the 
response object type
+inMessage.setHeader(CxfConstants.CAMEL_CXF_RS_RESPONSE_CLASS, 
Customer.class);
+inMessage.setHeader(Exchange.DESTINATION_OVERRIDE_URL, address);
+}
+}
 }


 


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> 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 

[jira] [Commented] (CAMEL-12252) Dynamic setting the DESTINATION_OVERRIDE_URL doesn't work on CXFRS producer

2018-03-17 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/CAMEL-12252?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16403568#comment-16403568
 ] 

ASF GitHub Bot commented on CAMEL-12252:


aldettinger commented on issue #2218: fix CAMEL-12252 and add test case for it
URL: https://github.com/apache/camel/pull/2218#issuecomment-373938830
 
 
   Closing as the bug has been corrected in [another 
PR](https://github.com/apache/camel/pull/2256).


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> 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
>Assignee: Alex Dettinger
>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)


[jira] [Commented] (CAMEL-12252) Dynamic setting the DESTINATION_OVERRIDE_URL doesn't work on CXFRS producer

2018-03-17 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/CAMEL-12252?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16403570#comment-16403570
 ] 

ASF GitHub Bot commented on CAMEL-12252:


Github user aldettinger closed the pull request at:

https://github.com/apache/camel/pull/2218


> 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
>Assignee: Alex Dettinger
>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)


[jira] [Commented] (CAMEL-12252) Dynamic setting the DESTINATION_OVERRIDE_URL doesn't work on CXFRS producer

2018-03-17 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/CAMEL-12252?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16403438#comment-16403438
 ] 

ASF GitHub Bot commented on CAMEL-12252:


xldai commented on issue #2256: CAMEL-12252: Corrected a bug in the URL 
override mechanism
URL: https://github.com/apache/camel/pull/2256#issuecomment-373919087
 
 
   @aldettinger yes I confirm the test cases passed with your changes! Thanks!
   (Actually I did all most of the same changes than yours only except
   ```
   @Override
   protected JAXRSServerFactoryBean newJAXRSServerFactoryBean() {
   -checkBeanType(bean, JAXRSServerFactoryBean.class);
   -return (JAXRSServerFactoryBean)bean;
   +  return new JAXRSServerFactoryBean();
   }
   ```
   that's why I got many of the test caces failed)
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> 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
>Assignee: Alex Dettinger
>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)


[jira] [Commented] (CAMEL-12252) Dynamic setting the DESTINATION_OVERRIDE_URL doesn't work on CXFRS producer

2018-03-17 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/CAMEL-12252?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16403436#comment-16403436
 ] 

ASF GitHub Bot commented on CAMEL-12252:


xldai commented on issue #2256: CAMEL-12252: Corrected a bug in the URL 
override mechanism
URL: https://github.com/apache/camel/pull/2256#issuecomment-373919087
 
 
   @aldettinger yes I confirm the test cases passed with your changes! Thanks!
   (Actually I did all most of the same changes than yours only except
   ``
   @Override
   protected JAXRSServerFactoryBean newJAXRSServerFactoryBean() {
   -checkBeanType(bean, JAXRSServerFactoryBean.class);
   -return (JAXRSServerFactoryBean)bean;
   +  return new JAXRSServerFactoryBean();
   }
   ``
   that's why I got many of the test caces failed)
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> 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
>Assignee: Alex Dettinger
>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)


[jira] [Commented] (CAMEL-12252) Dynamic setting the DESTINATION_OVERRIDE_URL doesn't work on CXFRS producer

2018-03-17 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/CAMEL-12252?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16403435#comment-16403435
 ] 

ASF GitHub Bot commented on CAMEL-12252:


xldai commented on issue #2256: CAMEL-12252: Corrected a bug in the URL 
override mechanism
URL: https://github.com/apache/camel/pull/2256#issuecomment-373919087
 
 
   @aldettinger yes I confirm the test cases passed with your changes! Thanks!
   (Actually I did all most of the same changes than yours only except
   @Override
   protected JAXRSServerFactoryBean newJAXRSServerFactoryBean() {
   -checkBeanType(bean, JAXRSServerFactoryBean.class);
   -return (JAXRSServerFactoryBean)bean;
   +  return new JAXRSServerFactoryBean();
   }
   that's why I got many of the test caces failed)
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> 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
>Assignee: Alex Dettinger
>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)


[jira] [Commented] (CAMEL-12252) Dynamic setting the DESTINATION_OVERRIDE_URL doesn't work on CXFRS producer

2018-03-15 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/CAMEL-12252?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16401004#comment-16401004
 ] 

ASF GitHub Bot commented on CAMEL-12252:


aldettinger commented on issue #2218: fix CAMEL-12252 and add test case for it
URL: https://github.com/apache/camel/pull/2218#issuecomment-373496151
 
 
   @xldai I would propose to close this PR and move forward in 
[another](https://github.com/apache/camel/pull/2256)


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> 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
>Assignee: Alex Dettinger
>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)


[jira] [Commented] (CAMEL-12252) Dynamic setting the DESTINATION_OVERRIDE_URL doesn't work on CXFRS producer

2018-03-15 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/CAMEL-12252?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16401001#comment-16401001
 ] 

ASF GitHub Bot commented on CAMEL-12252:


GitHub user aldettinger opened a pull request:

https://github.com/apache/camel/pull/2256

CAMEL-12252: Corrected a bug in the URL override mechanism

More context in 
[CAMEL-12252](https://issues.apache.org/jira/browse/CAMEL-12252) and the 
[initial PR](https://github.com/apache/camel/pull/2218).


You can merge this pull request into a Git repository by running:

$ git pull https://github.com/aldettinger/camel master

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/camel/pull/2256.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #2256


commit ed07bef9b521133abb7dd20c2b0e698eaad4b053
Author: aldettinger 
Date:   2018-03-15T19:19:02Z

CAMEL-12252: Corrected a bug in the URL override mechanism




> 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
>Assignee: Alex Dettinger
>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)


[jira] [Commented] (CAMEL-12252) Dynamic setting the DESTINATION_OVERRIDE_URL doesn't work on CXFRS producer

2018-03-15 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/CAMEL-12252?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16401000#comment-16401000
 ] 

ASF GitHub Bot commented on CAMEL-12252:


aldettinger opened a new pull request #2256: CAMEL-12252: Corrected a bug in 
the URL override mechanism
URL: https://github.com/apache/camel/pull/2256
 
 
   More context in 
[CAMEL-12252](https://issues.apache.org/jira/browse/CAMEL-12252) and the 
[initial PR](https://github.com/apache/camel/pull/2218).
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> 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
>Assignee: Alex Dettinger
>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)


[jira] [Commented] (CAMEL-12252) Dynamic setting the DESTINATION_OVERRIDE_URL doesn't work on CXFRS producer

2018-03-15 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/CAMEL-12252?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16401002#comment-16401002
 ] 

ASF GitHub Bot commented on CAMEL-12252:


aldettinger commented on issue #2256: CAMEL-12252: Corrected a bug in the URL 
override mechanism
URL: https://github.com/apache/camel/pull/2256#issuecomment-373495840
 
 
   @xldai: I've setup a proposal which is working against camel tests. It would 
be great if you could check it against your environment.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> 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
>Assignee: Alex Dettinger
>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)


[jira] [Commented] (CAMEL-12252) Dynamic setting the DESTINATION_OVERRIDE_URL doesn't work on CXFRS producer

2018-02-28 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/CAMEL-12252?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16380756#comment-16380756
 ] 

ASF GitHub Bot commented on CAMEL-12252:


aldettinger commented on issue #2218: fix CAMEL-12252 and add test case for it
URL: https://github.com/apache/camel/pull/2218#issuecomment-369325411
 
 
   @xldai, few things to polish and I'll take a look then.
   
   On Wed, Feb 28, 2018 at 11:10 AM, Xilai Dai 
   wrote:
   
   > @aldettinger  Unfortunately, I got no
   > success after tried to adapt the newJAXRSClientFactoryBean() of the
   > CxfRsSpringEndpoint, could you pls looking into it?
   >
   > —
   > You are receiving this because you were mentioned.
   > Reply to this email directly, view it on GitHub
   > , or mute
   > the thread
   > 

   > .
   >
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> 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)


[jira] [Commented] (CAMEL-12252) Dynamic setting the DESTINATION_OVERRIDE_URL doesn't work on CXFRS producer

2018-02-28 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/CAMEL-12252?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16380087#comment-16380087
 ] 

ASF GitHub Bot commented on CAMEL-12252:


xldai commented on issue #2218: fix CAMEL-12252 and add test case for it
URL: https://github.com/apache/camel/pull/2218#issuecomment-369190830
 
 
   @aldettinger Unfortunately, I got no success after tried to adapt the 
newJAXRSClientFactoryBean() of the CxfRsSpringEndpoint, could you pls looking 
into it?


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> 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)


[jira] [Commented] (CAMEL-12252) Dynamic setting the DESTINATION_OVERRIDE_URL doesn't work on CXFRS producer

2018-02-24 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/CAMEL-12252?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16375903#comment-16375903
 ] 

ASF GitHub Bot commented on CAMEL-12252:


xldai commented on issue #2218: fix CAMEL-12252 and add test case for it
URL: https://github.com/apache/camel/pull/2218#issuecomment-368279488
 
 
   @aldettinger Sorry for delay I was on vacation and thanks for your finding 
out I will looking into the SpringRsEndpoint (as I remember, even the 
JAXRSClientFactoryBean is created from java code still got this issue but 
anyway I will look into it again)


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> 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)


[jira] [Commented] (CAMEL-12252) Dynamic setting the DESTINATION_OVERRIDE_URL doesn't work on CXFRS producer

2018-02-24 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/CAMEL-12252?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16375696#comment-16375696
 ] 

ASF GitHub Bot commented on CAMEL-12252:


aldettinger commented on issue #2218: fix CAMEL-12252 and add test case for it
URL: https://github.com/apache/camel/pull/2218#issuecomment-368246840
 
 
   @xldai, would you like to explore changing 
[newJAXRSClientFactoryBean(...)](https://github.com/apache/camel/blob/f8b6d5b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsSpringEndpoint.java#L62)
 ?
   
   Otherwise, I should be able to take a look next week.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> 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)


[jira] [Commented] (CAMEL-12252) Dynamic setting the DESTINATION_OVERRIDE_URL doesn't work on CXFRS producer

2018-02-22 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/CAMEL-12252?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16373513#comment-16373513
 ] 

ASF GitHub Bot commented on CAMEL-12252:


aldettinger commented on issue #2218: fix CAMEL-12252 and add test case for it
URL: https://github.com/apache/camel/pull/2218#issuecomment-367832813
 
 
   In the case at hand, each call to 
[createJAXRSClientFactoryBean(...)](https://github.com/apache/camel/blob/d577c2b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsProducer.java#L861)
 always return the same client factory bean instance but with an overridden 
address. We end up in a situation where 
[ClientFactoryBeanCache.get(address)](https://github.com/apache/camel/blob/d577c2b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsProducer.java#L855)
 could serve a factory bean with another address than requested.
   
   The `createJAXRSClientFactoryBean(...)` implementation was tweaked when [the 
rsClient scope changed to 
prototype](https://issues.apache.org/jira/browse/CAMEL-4648). But now, we have 
a single client factory bean since [the SpringRsEndpoint became a 
singleton](https://issues.apache.org/jira/browse/CAMEL-9176).
   
   Keeping in mind thread safety, I would explore how to change 
[newJAXRSClientFactoryBean(...)`](https://github.com/apache/camel/blob/f8b6d5b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsSpringEndpoint.java#L62)
 in order to make the cache keep references to immutable client factory 
bean**s**.
   
   Does it make sense ?


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> 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)


[jira] [Commented] (CAMEL-12252) Dynamic setting the DESTINATION_OVERRIDE_URL doesn't work on CXFRS producer

2018-02-12 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/CAMEL-12252?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16361458#comment-16361458
 ] 

ASF GitHub Bot commented on CAMEL-12252:


aldettinger commented on a change in pull request #2218: fix CAMEL-12252 and 
add test case for it
URL: https://github.com/apache/camel/pull/2218#discussion_r167690712
 
 

 ##
 File path: 
components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsProducer.java
 ##
 @@ -865,6 +865,7 @@ public JAXRSClientFactoryBean get(String address) throws 
Exception {
 LOG.trace("Created client factory bean and add to cache 
for address '{}'", address);
 
 } else {
+retVal.setAddress(address);
 
 Review comment:
   I don't think that the `ClientFactoryBeanCache` would be responsible to 
mutate its content. However, I've noticed that the `ClientFactoryBeanCache` 
contains multiple soft references to the same underlying object and I wonder if 
it could be the cause of the issue.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> 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)


[jira] [Commented] (CAMEL-12252) Dynamic setting the DESTINATION_OVERRIDE_URL doesn't work on CXFRS producer

2018-02-09 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/CAMEL-12252?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16359287#comment-16359287
 ] 

ASF GitHub Bot commented on CAMEL-12252:


GitHub user xldai opened a pull request:

https://github.com/apache/camel/pull/2218

fix CAMEL-12252 and add test case for it



You can merge this pull request into a Git repository by running:

$ git pull https://github.com/xldai/camel master

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/camel/pull/2218.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #2218


commit 80be0842ea7696066c7d570cc537e270d738d503
Author: xldai 
Date:   2018-02-10T06:41:24Z

fix CAMEL-12252 and add test case for it




> 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)


[jira] [Commented] (CAMEL-12252) Dynamic setting the DESTINATION_OVERRIDE_URL doesn't work on CXFRS producer

2018-02-09 Thread Xilai Dai (JIRA)

[ 
https://issues.apache.org/jira/browse/CAMEL-12252?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=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)


[jira] [Commented] (CAMEL-12252) Dynamic setting the DESTINATION_OVERRIDE_URL doesn't work on CXFRS producer

2018-02-09 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/CAMEL-12252?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16359286#comment-16359286
 ] 

ASF GitHub Bot commented on CAMEL-12252:


xldai opened a new pull request #2218: fix CAMEL-12252 and add test case for it
URL: https://github.com/apache/camel/pull/2218
 
 
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> 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)