[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

camel-cxfrs : Urls getting interchanged when CamelDestinationOverrideUrl is used


I have a camel route where I am setting Exchange.DESTINATION_OVERRIDE_URL
header to set a dynamic endpoint url to cxfrs producer component.

Issue with that is lot of times url from previous exchanges is getting set
instead of the freshly calculated url for the current exchange.

In order to fix the issue, I had to configure maxClientCacheSize = 1 on the
cxfrs component.  Below information from http://camel.apache.org/cxfrs.html.

New in 2.6, you can set a IN message header CamelDestinationOverrideUrl to
dynamically override the target destination Web Service or REST Service
defined in your routes.  The implementation caches CXF clients or
ClientFactoryBean in CxfProvider and CxfRsProvider.  This option allows you
to configure the maximum size of the cache.

I looked at the  JAXRSClientFactoryBean code where it caches
ClientFactoryBean but not getting what caused this issue.
was causing issue in the first place. please suggest.

sample trace log for one of the addresses:
[TRACE]: org.apache.camel.component.cxf.CxfEndpointUtils - Client address
is overridden by header 'CamelDestinationOverrideUrl' to value '