Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -250,8 +250,8 @@
{ "name": "camel.routecontroller.includeRoutes", "description": "Pattern for filtering routes to be included as supervised. The pattern is matching on route id, and endpoint uri for the route. Multiple patterns can be separated by comma. For example to include all kafka routes, you can say kafka:. And to include routes with specific route ids myRoute,myOtherRoute. The pattern supports wildcards and uses the matcher from org.apache.camel.support.PatternHelper#matchPattern.", "sourceType": "org.apache.camel.main.RouteControllerConfigurationProperties", "type": "string", "javaType": "java.lang.String" },
{ "name": "camel.routecontroller.initialDelay", "description": "Initial delay in milli seconds before the route controller starts, after CamelContext has been started.", "sourceType": "org.apache.camel.main.RouteControllerConfigurationProperties", "type": "integer", "javaType": "long" },
{ "name": "camel.routecontroller.threadPoolSize", "description": "The number of threads used by the route controller scheduled thread pool that are used for restarting routes. The pool uses 1 thread by default, but you can increase this to allow the controller to concurrently attempt to restart multiple routes in case more than one route has problems starting.", "sourceType": "org.apache.camel.main.RouteControllerConfigurationProperties", "type": "integer", "javaType": "int", "defaultValue": 1 },
{ "name": "camel.routecontroller.unhealthyOnExhausted", "description": "Whether to mark the route as unhealthy (down) when all restarting attempts (backoff) have failed and the route is not successfully started and the route manager is giving up. Setting this to true allows health checks to know about this and can report the Camel application as DOWN. The default is false.", "sourceType": "org.apache.camel.main.RouteControllerConfigurationProperties", "type": "boolean", "javaType": "boolean", "defaultValue": "false" },
{ "name": "camel.routecontroller.unhealthyOnRestarting", "description": "Whether to mark the route as unhealthy (down) when the route failed to initially start, and is being controlled for restarting (backoff). Setting this to true allows health checks to know about this and can report the Camel application as DOWN. The default is false.", "sourceType": "org.apache.camel.main.RouteControllerConfigurationProperties", "type": "boolean", "javaType": "boolean", "defaultValue": "false" },
{ "name": "camel.routecontroller.unhealthyOnExhausted", "description": "Whether to mark the route as unhealthy (down) when all restarting attempts (backoff) have failed and the route is not successfully started and the route manager is giving up. If setting this to false will make health checks ignore this problem and allow to report the Camel application as UP.", "sourceType": "org.apache.camel.main.RouteControllerConfigurationProperties", "type": "boolean", "javaType": "boolean", "defaultValue": true },
{ "name": "camel.routecontroller.unhealthyOnRestarting", "description": "Whether to mark the route as unhealthy (down) when the route failed to initially start, and is being controlled for restarting (backoff). If setting this to false will make health checks ignore this problem and allow to report the Camel application as UP.", "sourceType": "org.apache.camel.main.RouteControllerConfigurationProperties", "type": "boolean", "javaType": "boolean", "defaultValue": true },
{ "name": "camel.server.devConsoleEnabled", "description": "Whether to enable developer console (not intended for production use). Dev console must also be enabled on CamelContext. For example by setting camel.context.dev-console=true in application.properties, or via code camelContext.setDevConsole(true); If enabled then you can access a basic developer console on context-path: \/q\/dev.", "sourceType": "org.apache.camel.main.HttpServerConfigurationProperties", "type": "boolean", "javaType": "boolean", "defaultValue": "false" },
{ "name": "camel.server.enabled", "description": "Whether embedded HTTP server is enabled. By default, the server is not enabled.", "sourceType": "org.apache.camel.main.HttpServerConfigurationProperties", "type": "boolean", "javaType": "boolean", "defaultValue": "false" },
{ "name": "camel.server.healthCheckEnabled", "description": "Whether to enable health-check console. If enabled then you can access health-check status on context-path: \/q\/health", "sourceType": "org.apache.camel.main.HttpServerConfigurationProperties", "type": "boolean", "javaType": "boolean", "defaultValue": "false" },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,35 +108,25 @@ public interface SupervisingRouteController extends RouteController {
*/
void setBackOffMultiplier(double backOffMultiplier);

/**
* Whether to mark the route as unhealthy (down) when all restarting attempts (backoff) have failed and the route is
* not successfully started and the route manager is giving up.
*
* Setting this to true allows health checks to know about this and can report the Camel application as DOWN.
*
* The default is false.
*/
void setUnhealthyOnExhausted(boolean unhealthyOnExhausted);
boolean isUnhealthyOnExhausted();

/**
* Whether to mark the route as unhealthy (down) when all restarting attempts (backoff) have failed and the route is
* not successfully started and the route manager is giving up.
*
* Setting this to true allows health checks to know about this and can report the Camel application as DOWN.
*
* The default is false.
* If setting this to false will make health checks ignore this problem and allow to report the Camel application as
* UP.
*/
boolean isUnhealthyOnExhausted();
void setUnhealthyOnExhausted(boolean unhealthyOnExhausted);

boolean isUnhealthyOnRestarting();

/**
* Whether to mark the route as unhealthy (down) when the route failed to initially start, and is being controlled
* for restarting (backoff).
*
* Setting this to true allows health checks to know about this and can report the Camel application as DOWN.
*
* The default is false.
* If setting this to false will make health checks ignore this problem and allow to report the Camel application as
* UP.
*/
void setUnhealthyOnRestarting(boolean unhealthyOnRestarting);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ public class DefaultSupervisingRouteController extends DefaultRouteController im
private long backOffMaxElapsedTime;
private long backOffMaxAttempts;
private double backOffMultiplier = 1.0d;
private boolean unhealthyOnExhausted;
private boolean unhealthyOnRestarting;
private boolean unhealthyOnExhausted = true;
private boolean unhealthyOnRestarting = true;

public DefaultSupervisingRouteController() {
this.lock = new Object();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -250,8 +250,8 @@
{ "name": "camel.routecontroller.includeRoutes", "description": "Pattern for filtering routes to be included as supervised. The pattern is matching on route id, and endpoint uri for the route. Multiple patterns can be separated by comma. For example to include all kafka routes, you can say kafka:. And to include routes with specific route ids myRoute,myOtherRoute. The pattern supports wildcards and uses the matcher from org.apache.camel.support.PatternHelper#matchPattern.", "sourceType": "org.apache.camel.main.RouteControllerConfigurationProperties", "type": "string", "javaType": "java.lang.String" },
{ "name": "camel.routecontroller.initialDelay", "description": "Initial delay in milli seconds before the route controller starts, after CamelContext has been started.", "sourceType": "org.apache.camel.main.RouteControllerConfigurationProperties", "type": "integer", "javaType": "long" },
{ "name": "camel.routecontroller.threadPoolSize", "description": "The number of threads used by the route controller scheduled thread pool that are used for restarting routes. The pool uses 1 thread by default, but you can increase this to allow the controller to concurrently attempt to restart multiple routes in case more than one route has problems starting.", "sourceType": "org.apache.camel.main.RouteControllerConfigurationProperties", "type": "integer", "javaType": "int", "defaultValue": 1 },
{ "name": "camel.routecontroller.unhealthyOnExhausted", "description": "Whether to mark the route as unhealthy (down) when all restarting attempts (backoff) have failed and the route is not successfully started and the route manager is giving up. Setting this to true allows health checks to know about this and can report the Camel application as DOWN. The default is false.", "sourceType": "org.apache.camel.main.RouteControllerConfigurationProperties", "type": "boolean", "javaType": "boolean", "defaultValue": "false" },
{ "name": "camel.routecontroller.unhealthyOnRestarting", "description": "Whether to mark the route as unhealthy (down) when the route failed to initially start, and is being controlled for restarting (backoff). Setting this to true allows health checks to know about this and can report the Camel application as DOWN. The default is false.", "sourceType": "org.apache.camel.main.RouteControllerConfigurationProperties", "type": "boolean", "javaType": "boolean", "defaultValue": "false" },
{ "name": "camel.routecontroller.unhealthyOnExhausted", "description": "Whether to mark the route as unhealthy (down) when all restarting attempts (backoff) have failed and the route is not successfully started and the route manager is giving up. If setting this to false will make health checks ignore this problem and allow to report the Camel application as UP.", "sourceType": "org.apache.camel.main.RouteControllerConfigurationProperties", "type": "boolean", "javaType": "boolean", "defaultValue": true },
{ "name": "camel.routecontroller.unhealthyOnRestarting", "description": "Whether to mark the route as unhealthy (down) when the route failed to initially start, and is being controlled for restarting (backoff). If setting this to false will make health checks ignore this problem and allow to report the Camel application as UP.", "sourceType": "org.apache.camel.main.RouteControllerConfigurationProperties", "type": "boolean", "javaType": "boolean", "defaultValue": true },
{ "name": "camel.server.devConsoleEnabled", "description": "Whether to enable developer console (not intended for production use). Dev console must also be enabled on CamelContext. For example by setting camel.context.dev-console=true in application.properties, or via code camelContext.setDevConsole(true); If enabled then you can access a basic developer console on context-path: \/q\/dev.", "sourceType": "org.apache.camel.main.HttpServerConfigurationProperties", "type": "boolean", "javaType": "boolean", "defaultValue": "false" },
{ "name": "camel.server.enabled", "description": "Whether embedded HTTP server is enabled. By default, the server is not enabled.", "sourceType": "org.apache.camel.main.HttpServerConfigurationProperties", "type": "boolean", "javaType": "boolean", "defaultValue": "false" },
{ "name": "camel.server.healthCheckEnabled", "description": "Whether to enable health-check console. If enabled then you can access health-check status on context-path: \/q\/health", "sourceType": "org.apache.camel.main.HttpServerConfigurationProperties", "type": "boolean", "javaType": "boolean", "defaultValue": "false" },
Expand Down
4 changes: 2 additions & 2 deletions core/camel-main/src/main/docs/main.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,8 @@ The camel.routecontroller supports 12 options, which are listed below.
| *camel.routecontroller.include{zwsp}Routes* | Pattern for filtering routes to be included as supervised. The pattern is matching on route id, and endpoint uri for the route. Multiple patterns can be separated by comma. For example to include all kafka routes, you can say kafka:. And to include routes with specific route ids myRoute,myOtherRoute. The pattern supports wildcards and uses the matcher from org.apache.camel.support.PatternHelper#matchPattern. | | String
| *camel.routecontroller.initial{zwsp}Delay* | Initial delay in milli seconds before the route controller starts, after CamelContext has been started. | | long
| *camel.routecontroller.thread{zwsp}PoolSize* | The number of threads used by the route controller scheduled thread pool that are used for restarting routes. The pool uses 1 thread by default, but you can increase this to allow the controller to concurrently attempt to restart multiple routes in case more than one route has problems starting. | 1 | int
| *{zwsp}camel.routecontroller.unhealthy{zwsp}OnExhausted* | Whether to mark the route as unhealthy (down) when all restarting attempts (backoff) have failed and the route is not successfully started and the route manager is giving up. Setting this to true allows health checks to know about this and can report the Camel application as DOWN. The default is false. | false | boolean
| *{zwsp}camel.routecontroller.unhealthy{zwsp}OnRestarting* | Whether to mark the route as unhealthy (down) when the route failed to initially start, and is being controlled for restarting (backoff). Setting this to true allows health checks to know about this and can report the Camel application as DOWN. The default is false. | false | boolean
| *{zwsp}camel.routecontroller.unhealthy{zwsp}OnExhausted* | Whether to mark the route as unhealthy (down) when all restarting attempts (backoff) have failed and the route is not successfully started and the route manager is giving up. If setting this to false will make health checks ignore this problem and allow to report the Camel application as UP. | true | boolean
| *{zwsp}camel.routecontroller.unhealthy{zwsp}OnRestarting* | Whether to mark the route as unhealthy (down) when the route failed to initially start, and is being controlled for restarting (backoff). If setting this to false will make health checks ignore this problem and allow to report the Camel application as UP. | true | boolean
|===


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ public class RouteControllerConfigurationProperties implements BootstrapCloseabl
private String includeRoutes;
@Metadata
private String excludeRoutes;
@Metadata
private boolean unhealthyOnExhausted;
@Metadata
private boolean unhealthyOnRestarting;
@Metadata(label = "advanced", defaultValue = "true")
private boolean unhealthyOnExhausted = true;
@Metadata(label = "advanced", defaultValue = "true")
private boolean unhealthyOnRestarting = true;
@Metadata
private long initialDelay;
@Metadata(defaultValue = "2000")
Expand Down Expand Up @@ -206,9 +206,8 @@ public boolean isUnhealthyOnExhausted() {
* Whether to mark the route as unhealthy (down) when all restarting attempts (backoff) have failed and the route is
* not successfully started and the route manager is giving up.
*
* Setting this to true allows health checks to know about this and can report the Camel application as DOWN.
*
* The default is false.
* If setting this to false will make health checks ignore this problem and allow to report the Camel application as
* UP.
*/
public void setUnhealthyOnExhausted(boolean unhealthyOnExhausted) {
this.unhealthyOnExhausted = unhealthyOnExhausted;
Expand All @@ -222,9 +221,8 @@ public boolean isUnhealthyOnRestarting() {
* Whether to mark the route as unhealthy (down) when the route failed to initially start, and is being controlled
* for restarting (backoff).
*
* Setting this to true allows health checks to know about this and can report the Camel application as DOWN.
*
* The default is false.
* If setting this to false will make health checks ignore this problem and allow to report the Camel application as
* UP.
*/
public void setUnhealthyOnRestarting(boolean unhealthyOnRestarting) {
this.unhealthyOnRestarting = unhealthyOnRestarting;
Expand Down Expand Up @@ -336,9 +334,8 @@ public RouteControllerConfigurationProperties withExcludeRoutes(String excludeRo
* Whether to mark the route as unhealthy (down) when all restarting attempts (backoff) have failed and the route is
* not successfully started and the route manager is giving up.
*
* Setting this to true allows health checks to know about this and can report the Camel application as DOWN.
*
* The default is false.
* If setting this to false will make health checks ignore this problem and allow to report the Camel application as
* UP.
*/
public RouteControllerConfigurationProperties withUnhealthyOnExhausted(boolean unhealthyOnExhausted) {
this.unhealthyOnExhausted = unhealthyOnExhausted;
Expand All @@ -349,9 +346,8 @@ public RouteControllerConfigurationProperties withUnhealthyOnExhausted(boolean u
* Whether to mark the route as unhealthy (down) when the route failed to initially start, and is being controlled
* for restarting (backoff).
*
* Setting this to true allows health checks to know about this and can report the Camel application as DOWN.
*
* The default is false.
* If setting this to false will make health checks ignore this problem and allow to report the Camel application as
* UP.
*/
public RouteControllerConfigurationProperties withUnhealthyOnRestarting(boolean unhealthyOnRestarting) {
this.unhealthyOnRestarting = unhealthyOnRestarting;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ We have now implemented similar logic for the consumer health check as well (the
Previously a route that has not been started due to `auto-startup=false` would still have its consumer health-check being executed,
which could lead to DOWN due to consumer failing the check.

The `SupervisingRouteController` has now been pre-configured to report `DOWN` during restart attempts, and also when
giving up starting a route. It is the `UnhealthyOnExhausted` and `UnhealthyOnRestarting` options that have been changed to be default `true`.
To have previous behavior you can set these options to `false`.

=== DSL

The Load Balancer EIP has aligned naming and the following balancers has been renamed in XML and YAML DSL:
Expand Down
Loading