GitHub user willianantunes opened a pull request:
https://github.com/apache/camel/pull/2350
CAMEL-12541: rsClient does not work programmatically, only with XML
When the endpoint is created with the bean (see
[here](https://github.com/apache/camel/blob/39c0d63d923bfe9236834ecb1c4470bb7e9e7eaa/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsComponent.java#L76)
how it's found) is always available and is used for the consumer approach (see
the method
[newJAXRSServerFactoryBean](https://github.com/apache/camel/blob/39c0d63d923bfe9236834ecb1c4470bb7e9e7eaa/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsSpringEndpoint.java#L65)).
Now the [same
behavior](https://github.com/willianantunes/camel/blob/30a4bdbf0975c8efc06d504b751e88ec4af5e64a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsSpringEndpoint.java#L71)
is used for producer approach as nowadays [we always return a new instance of
SpringJAXRSClientFactoryBean](https://github.com/apache/camel/blob/39c0d63d923bfe9236834ecb1c4470bb7e9e7eaa/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsSpringEndpoint.java#L71).
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/willianantunes/camel
cxfrs-bean-programmatically
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/camel/pull/2350.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 #2350
----
commit 30a4bdbf0975c8efc06d504b751e88ec4af5e64a
Author: Willian Antunes <willian.lima.antunes@...>
Date: 2018-05-27T16:20:53Z
CAMEL-12541: Use configured bean instead of creating a new
When the endpoint is created the bean is always available and is used
for the consumer approach (newJAXRSServerFactoryBean). Now the same
behavior is used for producer approach (newJAXRSClientFactoryBean).
----
---