Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-6657

CXF Failover using JAXRS prevents header retrieval from ResponseExceptionMappers

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.7.17
    • Fix Version/s: 2.7.18, 3.0.7, 3.1.4
    • Component/s: Clustering, JAX-RS, Transports
    • Labels:
      None
    • Environment:

      JAXRS Client 2.7.17 with Sequential Failover and a ResponseExceptionMapper.

    • Estimated Complexity:
      Unknown
    • Flags:
      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.

        Attachments

          Activity

            People

            • Assignee:
              sergey_beryozkin Sergey Beryozkin
              Reporter:
              fleger Florian Léger
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: