THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
...
Code Block | ||||
---|---|---|---|---|
| ||||
org.apache.cxf.jaxrs.features.clustering.CircuitBreakerFailoverFeaturefeatureCircuitBreakerFailoverFeature feature = new org.apache.cxf.jaxrs.features.clustering.CircuitBreakerFailoverFeature(1, 60000); List<String> alternateAddresses = new ArrayList<String>(); // addresses are alternate addresses provided at start-up for (String s : address) { alternateAddresses.add(s); } SequentialStrategy strategy = new SequentialStrategy(); strategy.setAlternateAddresses(alternateAddresses); feature.setStrategy(strategy); JAXRSClientFactoryBean bean = new JAXRSClientFactoryBean(); bean.setAddress("http://localhost:8080/inactive-replica"); List<Feature> features = new ArrayList<Feature>(); features.add(feature); bean.setFeatures(features); // create proxy: bean.create(BookStore.class); // create web client bean.createWebClient(); |
...