Florian Léger created CXF-6657:
----------------------------------

             Summary: CXF Failover using JAXRS prevents header retrieval from 
ResponseExceptionMappers
                 Key: CXF-6657
                 URL: https://issues.apache.org/jira/browse/CXF-6657
             Project: CXF
          Issue Type: Bug
          Components: clusting, JAX-RS, Transports
    Affects Versions: 2.7.17
         Environment: JAXRS Client 2.7.17 with Sequential Failover and a 
ResponseExceptionMapper.
            Reporter: Florian Léger


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.




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to