camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lburgazz...@apache.org
Subject [08/10] camel git commit: CAMEL-11641: SupervisingRouteController : backOff should be renamed deaultBackoff
Date Tue, 08 Aug 2017 11:30:42 GMT
CAMEL-11641: SupervisingRouteController : backOff should be renamed deaultBackoff


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/b3ebc7b2
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/b3ebc7b2
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/b3ebc7b2

Branch: refs/heads/master
Commit: b3ebc7b2b730ca391bc669fad491f2d20625b5db
Parents: a25eb77
Author: lburgazzoli <lburgazzoli@gmail.com>
Authored: Mon Aug 7 09:21:24 2017 +0200
Committer: lburgazzoli <lburgazzoli@gmail.com>
Committed: Tue Aug 8 13:29:28 2017 +0200

----------------------------------------------------------------------
 .../src/main/java/org/apache/camel/util/backoff/BackOff.java   | 4 ++++
 .../boot/SupervisingRouteControllerAutoConfiguration.java      | 4 ++--
 .../spring/boot/SupervisingRouteControllerConfiguration.java   | 6 +++---
 .../src/main/resources/application.properties                  | 4 ++--
 4 files changed, 11 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/b3ebc7b2/camel-core/src/main/java/org/apache/camel/util/backoff/BackOff.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/util/backoff/BackOff.java b/camel-core/src/main/java/org/apache/camel/util/backoff/BackOff.java
index f38c957..85eb5ac 100644
--- a/camel-core/src/main/java/org/apache/camel/util/backoff/BackOff.java
+++ b/camel-core/src/main/java/org/apache/camel/util/backoff/BackOff.java
@@ -133,6 +133,10 @@ public final class BackOff {
         return new Builder();
     }
 
+    public static Builder builder(BackOff template) {
+        return new Builder().read(template);
+    }
+
     /**
      * A builder for {@link BackOff}
      */

http://git-wip-us.apache.org/repos/asf/camel/blob/b3ebc7b2/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/SupervisingRouteControllerAutoConfiguration.java
----------------------------------------------------------------------
diff --git a/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/SupervisingRouteControllerAutoConfiguration.java
b/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/SupervisingRouteControllerAutoConfiguration.java
index 7382c6f..abb747d 100644
--- a/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/SupervisingRouteControllerAutoConfiguration.java
+++ b/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/SupervisingRouteControllerAutoConfiguration.java
@@ -49,7 +49,7 @@ public class SupervisingRouteControllerAutoConfiguration {
     public RouteController routeController() {
         SupervisingRouteController controller = new SupervisingRouteController();
 
-        controller.setDefaultBackOff(configureBackOff(Optional.empty(), configuration.getBackOff()));
+        controller.setDefaultBackOff(configureBackOff(Optional.empty(), configuration.getDefaultBackOff()));
 
         for (Map.Entry<String, RouteConfiguration> entry: configuration.getRoutes().entrySet())
{
             controller.setBackOff(
@@ -65,7 +65,7 @@ public class SupervisingRouteControllerAutoConfiguration {
     }
 
     private BackOff configureBackOff(Optional<BackOff> template, BackOffConfiguration
conf) {
-        final BackOff.Builder builder = template.map(t -> BackOff.builder().read(t)).orElseGet(BackOff::builder);
+        final BackOff.Builder builder = template.map(BackOff::builder).orElseGet(BackOff::builder);
 
         Optional.ofNullable(conf.getDelay()).map(TimePatternConverter::toMilliSeconds).ifPresent(builder::delay);
         Optional.ofNullable(conf.getMaxDelay()).map(TimePatternConverter::toMilliSeconds).ifPresent(builder::maxDelay);

http://git-wip-us.apache.org/repos/asf/camel/blob/b3ebc7b2/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/SupervisingRouteControllerConfiguration.java
----------------------------------------------------------------------
diff --git a/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/SupervisingRouteControllerConfiguration.java
b/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/SupervisingRouteControllerConfiguration.java
index bf68b6a..fb667b3 100644
--- a/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/SupervisingRouteControllerConfiguration.java
+++ b/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/SupervisingRouteControllerConfiguration.java
@@ -31,7 +31,7 @@ public class SupervisingRouteControllerConfiguration {
     /**
      * The default back-off configuration, back-off configuration for routes inherits from
this default.
      */
-    private BackOffConfiguration backOff = new BackOffConfiguration();
+    private BackOffConfiguration defaultBackOff = new BackOffConfiguration();
 
     /**
      * Routes configuration.
@@ -46,8 +46,8 @@ public class SupervisingRouteControllerConfiguration {
         this.enabled = enabled;
     }
 
-    public BackOffConfiguration getBackOff() {
-        return backOff;
+    public BackOffConfiguration getDefaultBackOff() {
+        return defaultBackOff;
     }
 
     public Map<String, RouteConfiguration> getRoutes() {

http://git-wip-us.apache.org/repos/asf/camel/blob/b3ebc7b2/examples/camel-example-spring-boot-routecontroller/src/main/resources/application.properties
----------------------------------------------------------------------
diff --git a/examples/camel-example-spring-boot-routecontroller/src/main/resources/application.properties
b/examples/camel-example-spring-boot-routecontroller/src/main/resources/application.properties
index 54d3318..9cd0c34 100644
--- a/examples/camel-example-spring-boot-routecontroller/src/main/resources/application.properties
+++ b/examples/camel-example-spring-boot-routecontroller/src/main/resources/application.properties
@@ -37,7 +37,7 @@ management.security.enabled = false
 camel.springboot.name = SampleSupervisingRouteController
 
 camel.supervising.controller.enabled = true
-camel.supervising.controller.back-off.delay = 5s
-camel.supervising.controller.back-off.max-attempts = 10
+camel.supervising.controller.default-back-off.delay = 5s
+camel.supervising.controller.default-back-off.max-attempts = 10
 camel.supervising.controller.routes.undertow.back-off.delay = 10s
 camel.supervising.controller.routes.undertow.back-off.max-attempts = 3


Mime
View raw message