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

AbstractStaticFailoverStrategy.getEndpoints() never returns anything for JAX-RS clients (with RetryStrategy)

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.3.6, 3.2.13
    • 3.2.14, 3.3.7, 3.4.0
    • None
    • None
    • Unknown

    Description

      When creating a JAX-RS client like described in https://cxf.apache.org/docs/jax-rs-failover.html with

      JAXRSClientFactoryBean bean = new JAXRSClientFactoryBean();
      bean.setAddress(API_BASE_ADDRESS);
      FailoverFeature failoverFeature = new CircuitBreakerFailoverFeature();
      RetryStrategy retryStrategy = new RetryStrategy();
      retryStrategy.setMaxNumberOfRetries(3);
      failoverFeature.setStrategy(retryStrategy);
      bean.setFeatures(Collection.singletonList(failureFeature));
      
      WebClient webClient = bean.createWebClient();
              
      T proxy = JAXRSClientFactory.fromClient(webClient, clazz);
      

      The method https://github.com/apache/cxf/blob/517b88cb2c293115e0dce1c1105f448e9dc21164/rt/features/clustering/src/main/java/org/apache/cxf/clustering/AbstractStaticFailoverStrategy.java#L133 always returns an empty list (due to the https://github.com/apache/cxf/blob/517b88cb2c293115e0dce1c1105f448e9dc21164/rt/features/clustering/src/main/java/org/apache/cxf/clustering/AbstractStaticFailoverStrategy.java#L135 getting the empty list from https://github.com/apache/cxf/blob/38582fbab7ca33b1383715f1f5094b9b46a0303f/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/JAXRSServiceImpl.java#L112).

      Why is the endpoints/services not correctly set up for Jax RS clients for the failover handling to work. What else do I need to do here?

      Attachments

        Issue Links

          Activity

            People

              reta Andriy Redko
              kwin Konrad Windszus
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: