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/04/11 07:29:52 UTC
[camel] branch master updated: CAMEL-14179: microprofile fault
tolerance
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.git
The following commit(s) were added to refs/heads/master by this push:
new 556be06 CAMEL-14179: microprofile fault tolerance
556be06 is described below
commit 556be064e717899b8e83dacfd0a9e11266248a78
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Sat Apr 11 09:29:36 2020 +0200
CAMEL-14179: microprofile fault tolerance
---
.../camel-main-configuration-metadata.json | 27 +++++++++++-----------
.../maven/packaging/PrepareCamelMainMojo.java | 3 +++
2 files changed, 17 insertions(+), 13 deletions(-)
diff --git a/core/camel-main/src/generated/resources/META-INF/camel-main-configuration-metadata.json b/core/camel-main/src/generated/resources/META-INF/camel-main-configuration-metadata.json
index c909376..f3fe6c9 100644
--- a/core/camel-main/src/generated/resources/META-INF/camel-main-configuration-metadata.json
+++ b/core/camel-main/src/generated/resources/META-INF/camel-main-configuration-metadata.json
@@ -3,6 +3,7 @@
{ "name": "camel.main", "description": "camel-main configurations.", "sourceType": "org.apache.camel.main.DefaultConfigurationProperties" },
{ "name": "camel.hystrix", "description": "camel-hystrix configurations.", "sourceType": "org.apache.camel.main.HystrixConfigurationProperties" },
{ "name": "camel.resilience4j", "description": "camel-resilience4j configurations.", "sourceType": "org.apache.camel.main.Resilience4jConfigurationProperties" },
+ { "name": "camel.faulttolerance", "description": "camel-fault-tolerance configurations.", "sourceType": "org.apache.camel.main.FaultToleranceConfigurationProperties" },
{ "name": "camel.rest", "description": "camel-rest configurations.", "sourceType": "org.apache.camel.spi.RestConfiguration" }
],
"properties": [
@@ -19,14 +20,8 @@
{ "name": "camel.main.backlogTracing", "description": "Sets whether backlog tracing is enabled or not. Default is false.", "sourceType": "org.apache.camel.main.DefaultConfigurationProperties", "type": "boolean", "javaType": "boolean" },
{ "name": "camel.main.beanIntrospectionExtendedStatistics", "description": "Sets whether bean introspection uses extended statistics. The default is false.", "sourceType": "org.apache.camel.main.DefaultConfigurationProperties", "type": "boolean", "javaType": "boolean" },
{ "name": "camel.main.beanIntrospectionLoggingLevel", "description": "Sets the logging level used by bean introspection, logging activity of its usage. The default is TRACE.", "sourceType": "org.apache.camel.main.DefaultConfigurationProperties", "type": "object", "javaType": "org.apache.camel.LoggingLevel", "enum": [ "ERROR", "WARN", "INFO", "DEBUG", "TRACE", "OFF" ] },
- { "name": "camel.main.bulkheadEnabled", "description": "Whether bulkhead is enabled or not on the circuit breaker. Default is false.", "sourceType": "org.apache.camel.main.FaultToleranceConfigurationProperties", "type": "boolean", "javaType": "java.lang.Boolean" },
- { "name": "camel.main.bulkheadExecutorServiceRef", "description": "References to a custom thread pool to use when bulkhead is enabled.", "sourceType": "org.apache.camel.main.FaultToleranceConfigurationProperties", "type": "string", "javaType": "java.lang.String" },
- { "name": "camel.main.bulkheadMaxConcurrentCalls", "description": "Configures the max amount of concurrent calls the bulkhead will support. Default value is 10.", "sourceType": "org.apache.camel.main.FaultToleranceConfigurationProperties", "type": "integer", "javaType": "java.lang.Integer" },
- { "name": "camel.main.bulkheadWaitingTaskQueue", "description": "Configures the task queue size for holding waiting tasks to be processed by the bulkhead. Default value is 10.", "sourceType": "org.apache.camel.main.FaultToleranceConfigurationProperties", "type": "integer", "javaType": "java.lang.Integer" },
{ "name": "camel.main.caseInsensitiveHeaders", "description": "Whether to use case sensitive or insensitive headers. Important: When using case sensitive (this is set to false). Then the map is case sensitive which means headers such as content-type and Content-Type are two different keys which can be a problem for some protocols such as HTTP based, which rely on case insensitive headers. However case sensitive implementations can yield faster performance. Therefore use case sensitiv [...]
- { "name": "camel.main.circuitBreakerRef", "description": "Refers to an existing io.smallrye.faulttolerance.core.circuit.breaker.CircuitBreaker instance to lookup and use from the registry. When using this, then any other circuit breaker options are not in use.", "sourceType": "org.apache.camel.main.FaultToleranceConfigurationProperties", "type": "string", "javaType": "java.lang.String" },
{ "name": "camel.main.consumerTemplateCacheSize", "description": "Consumer template endpoints cache size.", "sourceType": "org.apache.camel.main.DefaultConfigurationProperties", "type": "integer", "javaType": "int", "defaultValue": 1000 },
- { "name": "camel.main.delay", "description": "Control how long the circuit breaker stays open. The value are in seconds and the default is 5 seconds.", "sourceType": "org.apache.camel.main.FaultToleranceConfigurationProperties", "type": "integer", "javaType": "java.lang.Long" },
{ "name": "camel.main.durationHitExitCode", "description": "Sets the exit code for the application if duration was hit", "sourceType": "org.apache.camel.main.MainConfigurationProperties", "type": "integer", "javaType": "int" },
{ "name": "camel.main.durationMaxIdleSeconds", "description": "To specify for how long time in seconds Camel can be idle before automatic terminating the JVM. You can use this to run Camel for a short while.", "sourceType": "org.apache.camel.main.DefaultConfigurationProperties", "type": "integer", "javaType": "int" },
{ "name": "camel.main.durationMaxMessages", "description": "To specify how many messages to process by Camel before automatic terminating the JVM. You can use this to run Camel for a short while.", "sourceType": "org.apache.camel.main.DefaultConfigurationProperties", "type": "integer", "javaType": "int" },
@@ -35,7 +30,6 @@
{ "name": "camel.main.endpointBridgeErrorHandler", "description": "Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions occurred while the consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN\/ERROR level and ignored. The default va [...]
{ "name": "camel.main.endpointLazyStartProducer", "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first mes [...]
{ "name": "camel.main.endpointRuntimeStatisticsEnabled", "description": "Sets whether endpoint runtime statistics is enabled (gathers runtime usage of each incoming and outgoing endpoints). The default value is false.", "sourceType": "org.apache.camel.main.DefaultConfigurationProperties", "type": "boolean", "javaType": "boolean" },
- { "name": "camel.main.failureRatio", "description": "Configures the failure rate threshold in percentage. If the failure rate is equal or greater than the threshold the CircuitBreaker transitions to open and starts short-circuiting calls. The threshold must be greater than 0 and not greater than 100. Default value is 50 percentage.", "sourceType": "org.apache.camel.main.FaultToleranceConfigurationProperties", "type": "integer", "javaType": "java.lang.Integer" },
{ "name": "camel.main.fileConfigurations", "description": "Directory to load additional configuration files that contains configuration values that takes precedence over any other configuration. This can be used to refer to files that may have secret configuration that has been mounted on the file system for containers. You can specify a pattern to load from sub directories and a name pattern such as \/var\/app\/secret\/.properties, multiple directories can be separated by comma.", " [...]
{ "name": "camel.main.hangupInterceptorEnabled", "description": "Whether to use graceful hangup when Camel is stopping or when the JVM terminates.", "sourceType": "org.apache.camel.main.MainConfigurationProperties", "type": "boolean", "javaType": "boolean", "defaultValue": true },
{ "name": "camel.main.inflightRepositoryBrowseEnabled", "description": "Sets whether the inflight repository should allow browsing each inflight exchange. This is by default disabled as there is a very slight performance overhead when enabled.", "sourceType": "org.apache.camel.main.DefaultConfigurationProperties", "type": "boolean", "javaType": "boolean" },
@@ -54,7 +48,6 @@
{ "name": "camel.main.name", "description": "Sets the name of the CamelContext.", "sourceType": "org.apache.camel.main.DefaultConfigurationProperties", "type": "string", "javaType": "java.lang.String" },
{ "name": "camel.main.packageScanRouteBuilders", "description": "Sets package names for scanning for org.apache.camel.builder.RouteBuilder classes as candidates to be included. If you are using Spring Boot then its instead recommended to use Spring Boots component scanning and annotate your route builder classes with Component. In other words only use this for Camel Main in standalone mode.", "sourceType": "org.apache.camel.main.MainConfigurationProperties", "type": "string", "javaTy [...]
{ "name": "camel.main.producerTemplateCacheSize", "description": "Producer template endpoints cache size.", "sourceType": "org.apache.camel.main.DefaultConfigurationProperties", "type": "integer", "javaType": "int", "defaultValue": 1000 },
- { "name": "camel.main.requestVolumeThreshold", "description": "Controls the size of the rolling window used when the circuit breaker is closed Default value is 20.", "sourceType": "org.apache.camel.main.FaultToleranceConfigurationProperties", "type": "integer", "javaType": "java.lang.Integer" },
{ "name": "camel.main.routeFilterExcludePattern", "description": "Used for filtering routes routes matching the given pattern, which follows the following rules: - Match by route id - Match by route input endpoint uri The matching is using exact match, by wildcard and regular expression as documented by PatternHelper#matchPattern(String,String) . For example to only include routes which starts with foo in their route id's, use: include=foo* And to exclude routes which starts from [...]
{ "name": "camel.main.routeFilterIncludePattern", "description": "Used for filtering routes routes matching the given pattern, which follows the following rules: - Match by route id - Match by route input endpoint uri The matching is using exact match, by wildcard and regular expression as documented by PatternHelper#matchPattern(String,String) . For example to only include routes which starts with foo in their route id's, use: include=foo* And to exclude routes which starts from [...]
{ "name": "camel.main.routesCollectorEnabled", "description": "Whether the routes collector is enabled or not. When enabled Camel will auto-discover routes (RouteBuilder instances from the registry and also load additional XML routes from the file system. The routes collector is default enabled.", "sourceType": "org.apache.camel.main.DefaultConfigurationProperties", "type": "boolean", "javaType": "boolean", "defaultValue": true },
@@ -73,12 +66,7 @@
{ "name": "camel.main.streamCachingSpoolUsedHeapMemoryLimit", "description": "Sets what the upper bounds should be when streamCachingSpoolUsedHeapMemoryThreshold is in use.", "sourceType": "org.apache.camel.main.DefaultConfigurationProperties", "type": "string", "javaType": "java.lang.String" },
{ "name": "camel.main.streamCachingSpoolUsedHeapMemoryThreshold", "description": "Sets a percentage (1-99) of used heap memory threshold to activate stream caching spooling to disk.", "sourceType": "org.apache.camel.main.DefaultConfigurationProperties", "type": "integer", "javaType": "int" },
{ "name": "camel.main.streamCachingStatisticsEnabled", "description": "Sets whether stream caching statistics is enabled.", "sourceType": "org.apache.camel.main.DefaultConfigurationProperties", "type": "boolean", "javaType": "boolean" },
- { "name": "camel.main.successThreshold", "description": "Controls the number of trial calls which are allowed when the circuit breaker is half-open Default value is 1.", "sourceType": "org.apache.camel.main.FaultToleranceConfigurationProperties", "type": "integer", "javaType": "java.lang.Integer" },
{ "name": "camel.main.threadNamePattern", "description": "Sets the thread name pattern used for creating the full thread name. The default pattern is: Camel (#camelId#) thread ##counter# - #name# Where #camelId# is the name of the CamelContext. and #counter# is a unique incrementing counter. and #name# is the regular thread name. You can also use #longName# which is the long thread name which can includes endpoint parameters etc.", "sourceType": "org.apache.camel.main.DefaultConfigur [...]
- { "name": "camel.main.timeoutDuration", "description": "Configures the thread execution timeout. Default value is 1000 milliseconds.", "sourceType": "org.apache.camel.main.FaultToleranceConfigurationProperties", "type": "integer", "javaType": "java.lang.Long" },
- { "name": "camel.main.timeoutEnabled", "description": "Whether timeout is enabled or not on the circuit breaker. Default is false.", "sourceType": "org.apache.camel.main.FaultToleranceConfigurationProperties", "type": "boolean", "javaType": "java.lang.Boolean" },
- { "name": "camel.main.timeoutPoolSize", "description": "Configures the pool size of the thread pool when timeout is enabled. Default value is 10.", "sourceType": "org.apache.camel.main.FaultToleranceConfigurationProperties", "type": "integer", "javaType": "java.lang.Integer" },
- { "name": "camel.main.timeoutScheduledExecutorServiceRef", "description": "References to a custom thread pool to use when timeout is enabled", "sourceType": "org.apache.camel.main.FaultToleranceConfigurationProperties", "type": "string", "javaType": "java.lang.String" },
{ "name": "camel.main.tracing", "description": "Sets whether tracing is enabled or not. Default is false.", "sourceType": "org.apache.camel.main.DefaultConfigurationProperties", "type": "boolean", "javaType": "boolean" },
{ "name": "camel.main.tracingPattern", "description": "Tracing pattern to match which node EIPs to trace. For example to match all To EIP nodes, use to. The pattern matches by node and route id's Multiple patterns can be separated by comma.", "sourceType": "org.apache.camel.main.DefaultConfigurationProperties", "type": "string", "javaType": "java.lang.String" },
{ "name": "camel.main.useBreadcrumb", "description": "Set whether breadcrumb is enabled. The default value is false.", "sourceType": "org.apache.camel.main.DefaultConfigurationProperties", "type": "boolean", "javaType": "boolean" },
@@ -86,6 +74,19 @@
{ "name": "camel.main.useMdcLogging", "description": "To turn on MDC logging", "sourceType": "org.apache.camel.main.DefaultConfigurationProperties", "type": "boolean", "javaType": "boolean" },
{ "name": "camel.main.xmlRests", "description": "Directory to scan for adding additional XML rests. You can turn this off by setting the value to false. Files can be loaded from either classpath or file by prefixing with classpath: or file: Wildcards is supported using a ANT pattern style paths, such as classpath:**\/*camel*.xml Notice when using wildcards, then there is additional overhead as the classpath is scanned, where as if you specific the exact name for each [...]
{ "name": "camel.main.xmlRoutes", "description": "Directory to scan for adding additional XML routes. You can turn this off by setting the value to false. Files can be loaded from either classpath or file by prefixing with classpath: or file: Wildcards is supported using a ANT pattern style paths, such as classpath:**\/*camel*.xml Notice when using wildcards, then there is additional overhead as the classpath is scanned, where as if you specific the exact name for eac [...]
+ { "name": "camel.faulttolerance.bulkheadEnabled", "description": "Whether bulkhead is enabled or not on the circuit breaker. Default is false.", "sourceType": "org.apache.camel.main.FaultToleranceConfigurationProperties", "type": "boolean", "javaType": "java.lang.Boolean" },
+ { "name": "camel.faulttolerance.bulkheadExecutorServiceRef", "description": "References to a custom thread pool to use when bulkhead is enabled.", "sourceType": "org.apache.camel.main.FaultToleranceConfigurationProperties", "type": "string", "javaType": "java.lang.String" },
+ { "name": "camel.faulttolerance.bulkheadMaxConcurrentCalls", "description": "Configures the max amount of concurrent calls the bulkhead will support. Default value is 10.", "sourceType": "org.apache.camel.main.FaultToleranceConfigurationProperties", "type": "integer", "javaType": "java.lang.Integer" },
+ { "name": "camel.faulttolerance.bulkheadWaitingTaskQueue", "description": "Configures the task queue size for holding waiting tasks to be processed by the bulkhead. Default value is 10.", "sourceType": "org.apache.camel.main.FaultToleranceConfigurationProperties", "type": "integer", "javaType": "java.lang.Integer" },
+ { "name": "camel.faulttolerance.circuitBreakerRef", "description": "Refers to an existing io.smallrye.faulttolerance.core.circuit.breaker.CircuitBreaker instance to lookup and use from the registry. When using this, then any other circuit breaker options are not in use.", "sourceType": "org.apache.camel.main.FaultToleranceConfigurationProperties", "type": "string", "javaType": "java.lang.String" },
+ { "name": "camel.faulttolerance.delay", "description": "Control how long the circuit breaker stays open. The value are in seconds and the default is 5 seconds.", "sourceType": "org.apache.camel.main.FaultToleranceConfigurationProperties", "type": "integer", "javaType": "java.lang.Long" },
+ { "name": "camel.faulttolerance.failureRatio", "description": "Configures the failure rate threshold in percentage. If the failure rate is equal or greater than the threshold the CircuitBreaker transitions to open and starts short-circuiting calls. The threshold must be greater than 0 and not greater than 100. Default value is 50 percentage.", "sourceType": "org.apache.camel.main.FaultToleranceConfigurationProperties", "type": "integer", "javaType": "java.lang.Integer" },
+ { "name": "camel.faulttolerance.requestVolumeThreshold", "description": "Controls the size of the rolling window used when the circuit breaker is closed Default value is 20.", "sourceType": "org.apache.camel.main.FaultToleranceConfigurationProperties", "type": "integer", "javaType": "java.lang.Integer" },
+ { "name": "camel.faulttolerance.successThreshold", "description": "Controls the number of trial calls which are allowed when the circuit breaker is half-open Default value is 1.", "sourceType": "org.apache.camel.main.FaultToleranceConfigurationProperties", "type": "integer", "javaType": "java.lang.Integer" },
+ { "name": "camel.faulttolerance.timeoutDuration", "description": "Configures the thread execution timeout. Default value is 1000 milliseconds.", "sourceType": "org.apache.camel.main.FaultToleranceConfigurationProperties", "type": "integer", "javaType": "java.lang.Long" },
+ { "name": "camel.faulttolerance.timeoutEnabled", "description": "Whether timeout is enabled or not on the circuit breaker. Default is false.", "sourceType": "org.apache.camel.main.FaultToleranceConfigurationProperties", "type": "boolean", "javaType": "java.lang.Boolean" },
+ { "name": "camel.faulttolerance.timeoutPoolSize", "description": "Configures the pool size of the thread pool when timeout is enabled. Default value is 10.", "sourceType": "org.apache.camel.main.FaultToleranceConfigurationProperties", "type": "integer", "javaType": "java.lang.Integer" },
+ { "name": "camel.faulttolerance.timeoutScheduledExecutorServiceRef", "description": "References to a custom thread pool to use when timeout is enabled", "sourceType": "org.apache.camel.main.FaultToleranceConfigurationProperties", "type": "string", "javaType": "java.lang.String" },
{ "name": "camel.hystrix.allowMaximumSizeToDivergeFromCoreSize", "description": "Allows the configuration for maximumSize to take effect. That value can then be equal to, or higher, than coreSize", "sourceType": "org.apache.camel.main.HystrixConfigurationProperties", "type": "boolean", "javaType": "java.lang.Boolean" },
{ "name": "camel.hystrix.circuitBreakerEnabled", "description": "Whether to use a HystrixCircuitBreaker or not. If false no circuit-breaker logic will be used and all requests permitted. This is similar in effect to circuitBreakerForceClosed() except that continues tracking metrics and knowing whether it should be open\/closed, this property results in not even instantiating a circuit-breaker.", "sourceType": "org.apache.camel.main.HystrixConfigurationProperties", "type": "boolean", [...]
{ "name": "camel.hystrix.circuitBreakerErrorThresholdPercentage", "description": "Error percentage threshold (as whole number such as 50) at which point the circuit breaker will trip open and reject requests. It will stay tripped for the duration defined in circuitBreakerSleepWindowInMilliseconds; The error percentage this is compared against comes from HystrixCommandMetrics.getHealthCounts().", "sourceType": "org.apache.camel.main.HystrixConfigurationProperties", "type": "integer", [...]
diff --git a/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/PrepareCamelMainMojo.java b/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/PrepareCamelMainMojo.java
index ff24376..114dec9 100644
--- a/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/PrepareCamelMainMojo.java
+++ b/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/PrepareCamelMainMojo.java
@@ -167,6 +167,8 @@ public class PrepareCamelMainMojo extends AbstractGeneratorMojo {
prefix = "camel.hystrix.";
} else if (file.getName().contains("Resilience")) {
prefix = "camel.resilience4j.";
+ } else if (file.getName().contains("FaultTolerance")) {
+ prefix = "camel.faulttolerance.";
} else if (file.getName().contains("Rest")) {
prefix = "camel.rest.";
} else {
@@ -208,6 +210,7 @@ public class PrepareCamelMainMojo extends AbstractGeneratorMojo {
model.getGroups().add(new MainGroupModel("camel.main", "camel-main configurations.", "org.apache.camel.main.DefaultConfigurationProperties"));
model.getGroups().add(new MainGroupModel("camel.hystrix", "camel-hystrix configurations.", "org.apache.camel.main.HystrixConfigurationProperties"));
model.getGroups().add(new MainGroupModel("camel.resilience4j", "camel-resilience4j configurations.", "org.apache.camel.main.Resilience4jConfigurationProperties"));
+ model.getGroups().add(new MainGroupModel("camel.faulttolerance", "camel-fault-tolerance configurations.", "org.apache.camel.main.FaultToleranceConfigurationProperties"));
model.getGroups().add(new MainGroupModel("camel.rest", "camel-rest configurations.", "org.apache.camel.spi.RestConfiguration"));
String json = JsonMapper.createJsonSchema(model);