Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id BDE8F200B6E for ; Sat, 16 Jul 2016 17:53:27 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id BCD4D160A8A; Sat, 16 Jul 2016 15:53:27 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id F051E160A8E for ; Sat, 16 Jul 2016 17:53:26 +0200 (CEST) Received: (qmail 64369 invoked by uid 500); 16 Jul 2016 15:53:26 -0000 Mailing-List: contact commits-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list commits@cxf.apache.org Received: (qmail 64055 invoked by uid 99); 16 Jul 2016 15:53:25 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 16 Jul 2016 15:53:25 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 8F582EE686; Sat, 16 Jul 2016 15:53:25 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: reta@apache.org To: commits@cxf.apache.org Date: Sat, 16 Jul 2016 15:53:34 -0000 Message-Id: <88d6009ba9054ce6b7738c25adc4a211@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [10/20] cxf git commit: Updating the demo to use a curcuit breaker feature archived-at: Sat, 16 Jul 2016 15:53:27 -0000 Updating the demo to use a curcuit breaker feature Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/e2efd038 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/e2efd038 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/e2efd038 Branch: refs/heads/master-jaxrs-2.1 Commit: e2efd0386e210d162c7646f4a4f2aa15e9752924 Parents: df3854c Author: Sergey Beryozkin Authored: Fri Jul 15 18:01:44 2016 +0300 Committer: Sergey Beryozkin Committed: Fri Jul 15 18:01:44 2016 +0300 ---------------------------------------------------------------------- .../samples/jax_rs/spring_boot_scan/application/pom.xml | 6 ++++++ .../java/sample/rs/client/SampleRestClientApplication.java | 4 ++-- .../circuitbreaker/CircuitBreakerFailoverFeature.java | 6 ++++++ 3 files changed, 14 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cxf/blob/e2efd038/distribution/src/main/release/samples/jax_rs/spring_boot_scan/application/pom.xml ---------------------------------------------------------------------- diff --git a/distribution/src/main/release/samples/jax_rs/spring_boot_scan/application/pom.xml b/distribution/src/main/release/samples/jax_rs/spring_boot_scan/application/pom.xml index 4473bbd..50c3f98 100644 --- a/distribution/src/main/release/samples/jax_rs/spring_boot_scan/application/pom.xml +++ b/distribution/src/main/release/samples/jax_rs/spring_boot_scan/application/pom.xml @@ -14,6 +14,7 @@ 3.2.0-SNAPSHOT + 2.1 1.3.6.RELEASE 1.1.3.RELEASE @@ -45,6 +46,11 @@ spring-boot-actuator ${spring.boot.version} + + org.qi4j.library + org.qi4j.library.circuitbreaker + ${cxf.zest.version} + http://git-wip-us.apache.org/repos/asf/cxf/blob/e2efd038/distribution/src/main/release/samples/jax_rs/spring_boot_scan/application/src/main/java/sample/rs/client/SampleRestClientApplication.java ---------------------------------------------------------------------- diff --git a/distribution/src/main/release/samples/jax_rs/spring_boot_scan/application/src/main/java/sample/rs/client/SampleRestClientApplication.java b/distribution/src/main/release/samples/jax_rs/spring_boot_scan/application/src/main/java/sample/rs/client/SampleRestClientApplication.java index 4ec4e60..660cec9 100644 --- a/distribution/src/main/release/samples/jax_rs/spring_boot_scan/application/src/main/java/sample/rs/client/SampleRestClientApplication.java +++ b/distribution/src/main/release/samples/jax_rs/spring_boot_scan/application/src/main/java/sample/rs/client/SampleRestClientApplication.java @@ -25,9 +25,9 @@ import javax.ws.rs.core.UriBuilder; import org.apache.cxf.annotations.Provider; import org.apache.cxf.annotations.Provider.Type; -import org.apache.cxf.clustering.FailoverFeature; import org.apache.cxf.clustering.FailoverStrategy; import org.apache.cxf.clustering.RandomStrategy; +import org.apache.cxf.clustering.circuitbreaker.CircuitBreakerFailoverFeature; import org.apache.cxf.jaxrs.client.spring.EnableJaxRsProxyClient; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.CommandLineRunner; @@ -69,7 +69,7 @@ public class SampleRestClientApplication { */ @Component @Provider(Type.Feature) - static class EurekaFailoverFeature extends FailoverFeature { + static class EurekaFailoverFeature extends CircuitBreakerFailoverFeature { @Autowired DiscoveryClient discoveryClient; List addresses = new LinkedList(); http://git-wip-us.apache.org/repos/asf/cxf/blob/e2efd038/rt/features/clustering/src/main/java/org/apache/cxf/clustering/circuitbreaker/CircuitBreakerFailoverFeature.java ---------------------------------------------------------------------- diff --git a/rt/features/clustering/src/main/java/org/apache/cxf/clustering/circuitbreaker/CircuitBreakerFailoverFeature.java b/rt/features/clustering/src/main/java/org/apache/cxf/clustering/circuitbreaker/CircuitBreakerFailoverFeature.java index 3a1b73c..bc37632 100644 --- a/rt/features/clustering/src/main/java/org/apache/cxf/clustering/circuitbreaker/CircuitBreakerFailoverFeature.java +++ b/rt/features/clustering/src/main/java/org/apache/cxf/clustering/circuitbreaker/CircuitBreakerFailoverFeature.java @@ -34,6 +34,12 @@ public class CircuitBreakerFailoverFeature extends FailoverFeature { CircuitBreakerTargetSelector.DEFAULT_TIMEOUT); } + public CircuitBreakerFailoverFeature(String clientBootstrapAddress) { + this(CircuitBreakerTargetSelector.DEFAULT_THESHOLD, + CircuitBreakerTargetSelector.DEFAULT_TIMEOUT, + clientBootstrapAddress); + } + public CircuitBreakerFailoverFeature(int threshold, long timeout) { this.threshold = threshold; this.timeout = timeout;