You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2020/05/11 09:57:05 UTC
[camel-spring-boot] branch master updated: CAMEL-15036: Make it
easier to use supervising route controller
This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-spring-boot.git
The following commit(s) were added to refs/heads/master by this push:
new 8c3d250 CAMEL-15036: Make it easier to use supervising route controller
8c3d250 is described below
commit 8c3d25090df6d20e68a544d5b701dfd43a96d8e2
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Mon May 11 11:56:53 2020 +0200
CAMEL-15036: Make it easier to use supervising route controller
---
.../org/apache/camel/spring/boot/CamelConfigurationProperties.java | 2 +-
.../camel/spring/boot/SupervisingRouteControllerRestartTest.java | 5 +++--
.../org/apache/camel/spring/boot/SupervisingRouteControllerTest.java | 5 +++--
3 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/CamelConfigurationProperties.java b/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/CamelConfigurationProperties.java
index 3afa5f1..5539875 100644
--- a/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/CamelConfigurationProperties.java
+++ b/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/CamelConfigurationProperties.java
@@ -530,7 +530,7 @@ public class CamelConfigurationProperties extends DefaultConfigurationProperties
* using a background thread. The controller allows to be configured with various
* settings to attempt to restart failing routes.
*/
- boolean routeControllerEnabled;
+ boolean routeControllerSuperviseEnabled;
/**
* The number of threads used by the route controller scheduled thread pool that are used for restarting
diff --git a/core/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/SupervisingRouteControllerRestartTest.java b/core/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/SupervisingRouteControllerRestartTest.java
index c0a6399..46e3c90 100644
--- a/core/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/SupervisingRouteControllerRestartTest.java
+++ b/core/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/SupervisingRouteControllerRestartTest.java
@@ -19,6 +19,7 @@ package org.apache.camel.spring.boot;
import java.util.concurrent.TimeUnit;
import org.apache.camel.CamelContext;
+import org.apache.camel.ExtendedCamelContext;
import org.apache.camel.ServiceStatus;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.spi.SupervisingRouteController;
@@ -45,7 +46,7 @@ import static org.awaitility.Awaitility.await;
properties = {
"camel.springboot.xml-routes = false",
"camel.springboot.main-run-controller = true",
- "camel.springboot.routeControllerEnabled = true",
+ "camel.springboot.routeControllerSuperviseEnabled = true",
"camel.springboot.routeControllerInitialDelay = 500",
"camel.springboot.routeControllerBackoffDelay = 1000",
"camel.springboot.routeControllerBackoffMaxAttempts = 5",
@@ -61,7 +62,7 @@ public class SupervisingRouteControllerRestartTest {
Assert.assertNotNull(context.getRouteController());
Assert.assertTrue(context.getRouteController() instanceof SupervisingRouteController);
- SupervisingRouteController controller = context.getRouteController().unwrap(SupervisingRouteController.class);
+ SupervisingRouteController controller = context.adapt(ExtendedCamelContext.class).getSupervisingRouteController();
// Wait for the controller to start the routes
await().atMost(3, TimeUnit.SECONDS).untilAsserted(() -> {
diff --git a/core/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/SupervisingRouteControllerTest.java b/core/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/SupervisingRouteControllerTest.java
index b48c18a..f358772 100644
--- a/core/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/SupervisingRouteControllerTest.java
+++ b/core/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/SupervisingRouteControllerTest.java
@@ -19,6 +19,7 @@ package org.apache.camel.spring.boot;
import java.util.concurrent.TimeUnit;
import org.apache.camel.CamelContext;
+import org.apache.camel.ExtendedCamelContext;
import org.apache.camel.ServiceStatus;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.spi.SupervisingRouteController;
@@ -46,7 +47,7 @@ import static org.awaitility.Awaitility.await;
"camel.springboot.xml-routes = false",
"camel.springboot.xml-rests = false",
"camel.springboot.main-run-controller = true",
- "camel.springboot.routeControllerEnabled = true",
+ "camel.springboot.routeControllerSuperviseEnabled = true",
"camel.springboot.routeControllerInitialDelay = 500",
"camel.springboot.routeControllerBackoffDelay = 1000",
"camel.springboot.routeControllerBackoffMaxAttempts = 5",
@@ -61,7 +62,7 @@ public class SupervisingRouteControllerTest {
Assert.assertNotNull(context.getRouteController());
Assert.assertTrue(context.getRouteController() instanceof SupervisingRouteController);
- SupervisingRouteController controller = context.getRouteController().unwrap(SupervisingRouteController.class);
+ SupervisingRouteController controller = context.adapt(ExtendedCamelContext.class).getSupervisingRouteController();
// Wait for the controller to start the routes
await().atMost(5, TimeUnit.SECONDS).untilAsserted(() -> {