Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.7.17
-
None
-
JAXRS Client 2.7.17 with Sequential Failover and a ResponseExceptionMapper.
-
Unknown
-
Patch
Description
Our custom ResponseExceptionMapper is designed to transform responses with status code 400 into client code exceptions by retrieving custom header properties.
This works as long as the failover feature is not enabled, were would want the failover code to be triggered only in case of support not available errors but let through other status codes
When using the FailoverFeature and even when setting the supportNotAvailableErrorsOnly property of the FailoverTargetSelector to true, an HttpException is raised in the handleResponseInternal method of HTTPConduit which prevents the headers from being updated in the input message.
This is due to the fact that the FailoverTargetSelector clears the org.apache.cxf.transport.no_io_exceptions flag set by JAXRS.
The attached patch make the FailoverTargetSelector clears the org.apache.cxf.transport.no_io_exceptions flag only when supportNotAvailableErrorsOnly is false. It also modifies HTTPConduit.handleResponseInternal to set org.apache.cxf.transport.service_not_available even if no IOExceptions should be thrown so that the failover code could catch such cases. Finally, it also make the preProcessResult method of jaxrs AbstractClient complete the conduit selector if org.apache.cxf.transport.service_not_available is true in case of failover.