[
https://issues.apache.org/jira/browse/CXF-5581?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Raul Kripalani updated CXF-5581:
--------------------------------
Attachment: CamelCxfAddressOverrideTest.java
Attached unit test built with Camel: [^CamelCxfAddressOverrideTest.java]. BTW:
I'm 100% confident this is not a Camel problem.
You can attain correct behaviour by suffixing this to the CXF Producer URI
inside the route:
{code}
&properties.org.apache.cxf.ConduitSelector.compareFullUrl=true
{code}
> Dynamic endpoint address is buggy unless ConduitSelector.compareFullUrl is
> enabled
> ----------------------------------------------------------------------------------
>
> Key: CXF-5581
> URL: https://issues.apache.org/jira/browse/CXF-5581
> Project: CXF
> Issue Type: Bug
> Components: Core
> Affects Versions: 2.7.6
> Reporter: Raul Kripalani
> Fix For: 3.0.0, 2.7.11
>
> Attachments: CamelCxfAddressOverrideTest.java
>
>
> When using the RequestContext Message.ENDPOINT_ADDRESS option in an CXF-WS
> client to override the configured endpoint address with a different one
> during runtime, the endpoint "fixates" on the first endpoint address ever
> effectively used after initialization.
> Try this:
> # Set up http://aaaa:8080 as the endpoint address in the configuration.
> # Initialize the JAX-WS client.
> # Send a first request with the Message.ENDPOINT_ADDRESS request context
> property set to http://bbbb:8080.
> # CXF calls http://bbbb:8080 correctly as expected.
> # Send a second request without the Message.ENDPOINT_ADDRESS property, i.e.
> no overriding.
> # You were expecting a call to http://aaaa:8080, but CXF calls
> http://bbbb:8080, because this is how the conduit was initialized.
> The problem lies in AbstractConduitSelector#findCompatibleConduit, which by
> default only uses the URI scheme (protocol, e.g. http, https) to select the
> conduit, failing to acknowledge that the address could have been overridden
> at runtime.
> This behaviour can be switched to the expected behaviour by explicitly
> setting the org.apache.cxf.ConduitSelector.compareFullUrl property to 'true'
> in the context.
> However, this is largely obscure, not documented anywhere and user
> unfriendly. In my opinion, it should work as expected OOTB.
--
This message was sent by Atlassian JIRA
(v6.1.5#6160)