diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs.properties b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs.properties
index f619507ee2de7..7d7f9a408f118 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs.properties
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs.properties
@@ -626,6 +626,7 @@ stripe-component
stub-component
swiftMt-dataformat
swiftMx-dataformat
+switch-eip
syslog-dataformat
tahu-edge-component
tahu-host-component
diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/switch-eip.adoc b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/switch-eip.adoc
new file mode 100644
index 0000000000000..79b1b441406f5
--- /dev/null
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/switch-eip.adoc
@@ -0,0 +1,184 @@
+= Switch EIP
+:doctitle: Switch
+:shortname: switch
+:description: Evaluates a selector once and dispatches to a fixed endpoint by literal scalar values
+:since: 4.23
+:supportlevel: Stable
+:tabs-sync-option:
+
+*Since Camel {since}*
+
+Switch selects one destination from a table declared by the route author.
+The selector can use any Camel expression language. Its result selects a case;
+it cannot supply a new endpoint URI.
+
+Use Switch for literal value dispatch. Use xref:choice-eip.adoc[Choice] for
+predicates, ranges, overlapping conditions, or nested processing steps. A case can
+send to a `direct:` route when more processing is needed. Use xref:toD-eip.adoc[To D]
+when the endpoint URI itself must be calculated dynamically.
+
+== Options
+
+// eip options: START
+include::partial$eip-options.adoc[]
+// eip options: END
+
+== Scalar selectors
+
+The selector is evaluated once on each entry. Scalar results are converted to strings
+and matched case-insensitively using the English locale. An empty string is a valid
+literal. An asterisk is literal, not a wildcard. Duplicate normalized values are
+rejected at startup.
+
+Map, collection and array results are rejected with an `IllegalArgumentException`.
+They follow normal Camel error handling and do not select `otherwise`.
+
+=== Route from a header
+
+This route reads the `department` header. The body is passed unchanged to the
+selected destination. The examples on this page are independent; load one at a
+time and connect the `direct:` destinations to your application's handling routes.
+
+[tabs]
+====
+Java::
++
+[source,java]
+----
+from("direct:tickets")
+ .doSwitch(header("department"))
+ .doCase("billing", "direct:billing")
+ .doCase("technical", "direct:technical")
+ .otherwise("direct:review")
+ .end();
+----
+XML::
++
+[source,xml]
+----
+
+
+
+
+
+
+
+
+
+----
+YAML::
++
+[source,yaml]
+----
+- route:
+ from:
+ uri: direct:tickets
+ steps:
+ - switch:
+ selector:
+ header:
+ expression: department
+ case:
+ - value: billing
+ uri: direct:billing
+ - value: technical
+ uri: direct:technical
+ otherwise:
+ uri: direct:review
+----
+====
+
+Send a message to any of these equivalent routes with a `ProducerTemplate`:
+
+[source,java]
+----
+template.sendBodyAndHeader("direct:tickets", "Please check this invoice",
+ "department", "BILLING");
+----
+
+[cols="1,2",options="header"]
+|===
+|Header value |Destination
+|`billing` or `BILLING` |`direct:billing`
+|`technical` |`direct:technical`
+|`sales` or an absent header |`direct:review`
+|===
+
+A null or unmatched result uses `otherwise`. Without `otherwise`, the exchange
+continues after Switch. Selector failures follow normal Camel error handling and
+never select the fallback. Streams are reset after selector evaluation when stream
+caching is enabled. Loops and retries that enter Switch again evaluate the selector
+again; results are not cached across entries.
+
+=== Connect the example destinations
+
+For a local demonstration, the destination routes can simply log the message.
+Load these routes alongside one of the examples above; replace the logging steps
+with the application's processing when integrating the example.
+
+[tabs]
+====
+Java::
++
+[source,java]
+----
+from("direct:billing").log("Billing: ${body}");
+from("direct:technical").log("Technical: ${body}");
+from("direct:review").log("Review: ${body}");
+----
+XML::
++
+[source,xml]
+----
+
+
+
+
+
+----
+YAML::
++
+[source,yaml]
+----
+- route:
+ from:
+ uri: direct:billing
+ steps:
+ - log: "Billing: ${body}"
+- route:
+ from:
+ uri: direct:technical
+ steps:
+ - log: "Technical: ${body}"
+- route:
+ from:
+ uri: direct:review
+ steps:
+ - log: "Review: ${body}"
+----
+====
+
+== Destinations and management
+
+Case and fallback URIs support property placeholders resolved at startup. Simple
+expressions in URIs are rejected. In YAML, both cases and `otherwise` accept `uri`
+plus `parameters`:
+
+[source,yaml]
+----
+case:
+ - value: orders
+ uri: kafka
+ parameters:
+ topic: orders
+otherwise:
+ uri: direct
+ parameters:
+ name: review
+----
+
+Each case has an identity for tracing, debugging and management. The Switch MBean's
+`extendedInformation` table reports case IDs, literal values, destination URIs and
+selection counts. URIs are masked when management masking is enabled (the default).
+These counts indicate case selection, not successful delivery.
+`UnmatchedCount` also records unmatched results when no fallback is configured.
diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models.properties b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models.properties
index 6b4b1f0db8fb6..387da664462d4 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models.properties
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models.properties
@@ -13,6 +13,7 @@ beanio
bearerToken
bindy
cache
+case
cbor
choice
circuitBreaker
@@ -196,6 +197,8 @@ stop
streamConfig
swiftMt
swiftMx
+switch
+switchOtherwise
syslog
tarFile
templateParameter
diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/a2aSubTask.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/a2aSubTask.json
index 4e3ac7673b7be..ebf2a61f68a74 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/a2aSubTask.json
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/a2aSubTask.json
@@ -21,6 +21,6 @@
"emitAfter": { "index": 5, "kind": "attribute", "displayName": "Emit After", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Simple expression template to emit after the nested steps complete successfully" },
"emitOnError": { "index": 6, "kind": "attribute", "displayName": "Emit On Error", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Simple expression template to emit when the nested steps fail" },
"failIfNoTaskContext": { "index": 7, "kind": "attribute", "displayName": "Fail If No Task Context", "group": "common", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether to fail if the current Exchange does not have an active A2A task context" },
- "outputs": { "index": 8, "kind": "element", "displayName": "Outputs", "group": "common", "required": true, "type": "array", "javaType": "java.util.List", "oneOf": [ "a2aSubTask", "aggregate", "bean", "cache", "choice", "circuitBreaker", "claimCheck", "convertBodyTo", "convertHeaderTo", "convertVariableTo", "delay", "doCatch", "doFinally", "doTry", "dynamicRouter", "enrich", "filter", "idempotentConsumer", "intercept", "interceptFrom", "interceptSendToEndpoint", "kamelet", "loadBalance", "log", "loop", "marshal", "multicast", "onCompletion", "onException", "pausable", "pipeline", "policy", "poll", "pollEnrich", "process", "recipientList", "removeHeader", "removeHeaders", "removeProperties", "removeProperty", "removeVariable", "resequence", "resumable", "rollback", "routingSlip", "saga", "sample", "script", "setBody", "setExchangePattern", "setHeader", "setHeaders", "setProperty", "setVariable", "setVariables", "sort", "split", "step", "stop", "threads", "throttle", "throwException", "to", "toD", "tokenizer", "transacted", "transform", "transformDataType", "unmarshal", "validate", "wireTap" ], "deprecated": false, "autowired": false, "secret": false }
+ "outputs": { "index": 8, "kind": "element", "displayName": "Outputs", "group": "common", "required": true, "type": "array", "javaType": "java.util.List", "oneOf": [ "a2aSubTask", "aggregate", "bean", "cache", "choice", "circuitBreaker", "claimCheck", "convertBodyTo", "convertHeaderTo", "convertVariableTo", "delay", "doCatch", "doFinally", "doTry", "dynamicRouter", "enrich", "filter", "idempotentConsumer", "intercept", "interceptFrom", "interceptSendToEndpoint", "kamelet", "loadBalance", "log", "loop", "marshal", "multicast", "onCompletion", "onException", "pausable", "pipeline", "policy", "poll", "pollEnrich", "process", "recipientList", "removeHeader", "removeHeaders", "removeProperties", "removeProperty", "removeVariable", "resequence", "resumable", "rollback", "routingSlip", "saga", "sample", "script", "setBody", "setExchangePattern", "setHeader", "setHeaders", "setProperty", "setVariable", "setVariables", "sort", "split", "step", "stop", "switch", "threads", "throttle", "throwException", "to", "toD", "tokenizer", "transacted", "transform", "transformDataType", "unmarshal", "validate", "wireTap" ], "deprecated": false, "autowired": false, "secret": false }
}
}
diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/aggregate.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/aggregate.json
index 0fb9ff69a07f9..b44e99f13f841 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/aggregate.json
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/aggregate.json
@@ -45,7 +45,7 @@
"discardOnAggregationFailure": { "index": 29, "kind": "attribute", "displayName": "Discard On Aggregation Failure", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "If enabled then the partly aggregated message is discarded when aggregation failed (an exception was thrown from AggregationStrategy). Cannot be used together with completionFromBatchConsumer." },
"forceCompletionOnStop": { "index": 30, "kind": "attribute", "displayName": "Force Completion On Stop", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "If enabled then all current aggregated exchanges are completed when the context is stopped." },
"completeAllOnStop": { "index": 31, "kind": "attribute", "displayName": "Complete All On Stop", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "If enabled then waits to complete all current and partial (pending) aggregated exchanges when the context is stopped, ensuring the aggregation repository is empty before shutdown." },
- "outputs": { "index": 32, "kind": "element", "displayName": "Outputs", "group": "common", "required": true, "type": "array", "javaType": "java.util.List", "oneOf": [ "a2aSubTask", "aggregate", "bean", "cache", "choice", "circuitBreaker", "claimCheck", "convertBodyTo", "convertHeaderTo", "convertVariableTo", "delay", "doCatch", "doFinally", "doTry", "dynamicRouter", "enrich", "filter", "idempotentConsumer", "intercept", "interceptFrom", "interceptSendToEndpoint", "kamelet", "loadBalance", "log", "loop", "marshal", "multicast", "onCompletion", "onException", "pausable", "pipeline", "policy", "poll", "pollEnrich", "process", "recipientList", "removeHeader", "removeHeaders", "removeProperties", "removeProperty", "removeVariable", "resequence", "resumable", "rollback", "routingSlip", "saga", "sample", "script", "setBody", "setExchangePattern", "setHeader", "setHeaders", "setProperty", "setVariable", "setVariables", "sort", "split", "step", "stop", "threads", "throttle", "throwException", "to", "toD", "tokenizer", "transacted", "transform", "transformDataType", "unmarshal", "validate", "wireTap" ], "deprecated": false, "autowired": false, "secret": false }
+ "outputs": { "index": 32, "kind": "element", "displayName": "Outputs", "group": "common", "required": true, "type": "array", "javaType": "java.util.List", "oneOf": [ "a2aSubTask", "aggregate", "bean", "cache", "choice", "circuitBreaker", "claimCheck", "convertBodyTo", "convertHeaderTo", "convertVariableTo", "delay", "doCatch", "doFinally", "doTry", "dynamicRouter", "enrich", "filter", "idempotentConsumer", "intercept", "interceptFrom", "interceptSendToEndpoint", "kamelet", "loadBalance", "log", "loop", "marshal", "multicast", "onCompletion", "onException", "pausable", "pipeline", "policy", "poll", "pollEnrich", "process", "recipientList", "removeHeader", "removeHeaders", "removeProperties", "removeProperty", "removeVariable", "resequence", "resumable", "rollback", "routingSlip", "saga", "sample", "script", "setBody", "setExchangePattern", "setHeader", "setHeaders", "setProperty", "setVariable", "setVariables", "sort", "split", "step", "stop", "switch", "threads", "throttle", "throwException", "to", "toD", "tokenizer", "transacted", "transform", "transformDataType", "unmarshal", "validate", "wireTap" ], "deprecated": false, "autowired": false, "secret": false }
},
"exchangeProperties": {
"CamelAggregatedSize": { "index": 0, "kind": "exchangeProperty", "displayName": "Aggregated Size", "label": "producer", "required": false, "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "important": true, "description": "Number of exchanges that was grouped together." },
diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/cache.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/cache.json
index 459a15180559f..08f5ce5c924b6 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/cache.json
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/cache.json
@@ -21,6 +21,6 @@
"keyValueRepository": { "index": 5, "kind": "attribute", "displayName": "Key Value Repository", "group": "common", "required": false, "type": "object", "javaType": "org.apache.camel.spi.KeyValueRepository", "deprecated": false, "autowired": false, "secret": false, "description": "Sets the reference name of the KeyValueRepository to use as the cache backing store. If not set, a MemoryKeyValueRepository is auto-created." },
"ttl": { "index": 6, "kind": "attribute", "displayName": "Ttl", "group": "common", "required": false, "type": "duration", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "-1", "description": "Sets the time-to-live for cached entries. Supports duration syntax (e.g. 10m, 1h) or milliseconds. Default: -1 (no expiration)." },
"cacheNull": { "index": 7, "kind": "attribute", "displayName": "Cache Null", "group": "common", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether to cache null results. By default, null message bodies are not cached." },
- "outputs": { "index": 8, "kind": "element", "displayName": "Outputs", "group": "common", "required": true, "type": "array", "javaType": "java.util.List>", "oneOf": [ "a2aSubTask", "aggregate", "bean", "cache", "choice", "circuitBreaker", "claimCheck", "convertBodyTo", "convertHeaderTo", "convertVariableTo", "delay", "doCatch", "doFinally", "doTry", "dynamicRouter", "enrich", "filter", "idempotentConsumer", "intercept", "interceptFrom", "interceptSendToEndpoint", "kamelet", "loadBalance", "log", "loop", "marshal", "multicast", "onCompletion", "onException", "pausable", "pipeline", "policy", "poll", "pollEnrich", "process", "recipientList", "removeHeader", "removeHeaders", "removeProperties", "removeProperty", "removeVariable", "resequence", "resumable", "rollback", "routingSlip", "saga", "sample", "script", "setBody", "setExchangePattern", "setHeader", "setHeaders", "setProperty", "setVariable", "setVariables", "sort", "split", "step", "stop", "threads", "throttle", "throwException", "to", "toD", "tokenizer", "transacted", "transform", "transformDataType", "unmarshal", "validate", "wireTap" ], "deprecated": false, "autowired": false, "secret": false }
+ "outputs": { "index": 8, "kind": "element", "displayName": "Outputs", "group": "common", "required": true, "type": "array", "javaType": "java.util.List>", "oneOf": [ "a2aSubTask", "aggregate", "bean", "cache", "choice", "circuitBreaker", "claimCheck", "convertBodyTo", "convertHeaderTo", "convertVariableTo", "delay", "doCatch", "doFinally", "doTry", "dynamicRouter", "enrich", "filter", "idempotentConsumer", "intercept", "interceptFrom", "interceptSendToEndpoint", "kamelet", "loadBalance", "log", "loop", "marshal", "multicast", "onCompletion", "onException", "pausable", "pipeline", "policy", "poll", "pollEnrich", "process", "recipientList", "removeHeader", "removeHeaders", "removeProperties", "removeProperty", "removeVariable", "resequence", "resumable", "rollback", "routingSlip", "saga", "sample", "script", "setBody", "setExchangePattern", "setHeader", "setHeaders", "setProperty", "setVariable", "setVariables", "sort", "split", "step", "stop", "switch", "threads", "throttle", "throwException", "to", "toD", "tokenizer", "transacted", "transform", "transformDataType", "unmarshal", "validate", "wireTap" ], "deprecated": false, "autowired": false, "secret": false }
}
}
diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/case.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/case.json
new file mode 100644
index 0000000000000..39ad4ab00f2c9
--- /dev/null
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/case.json
@@ -0,0 +1,21 @@
+{
+ "model": {
+ "kind": "model",
+ "name": "case",
+ "title": "Case",
+ "description": "A literal switch case with one fixed endpoint destination",
+ "deprecated": false,
+ "label": "configuration",
+ "javaType": "org.apache.camel.model.SwitchCaseDefinition",
+ "abstract": false,
+ "input": false,
+ "output": false
+ },
+ "properties": {
+ "id": { "index": 0, "kind": "attribute", "displayName": "Id", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The id of this node" },
+ "note": { "index": 1, "kind": "attribute", "displayName": "Note", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The note for this node" },
+ "description": { "index": 2, "kind": "attribute", "displayName": "Description", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The description for this node" },
+ "value": { "index": 3, "kind": "attribute", "displayName": "Value", "group": "common", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The case-insensitive literal value for a scalar selector." },
+ "uri": { "index": 4, "kind": "attribute", "displayName": "Uri", "group": "common", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The fixed destination URI. Supports property placeholders, but not Simple expressions." }
+ }
+}
diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/circuitBreaker.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/circuitBreaker.json
index 5880e386c3423..e9b6c76a5f46e 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/circuitBreaker.json
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/circuitBreaker.json
@@ -22,7 +22,7 @@
"resilience4jConfiguration": { "index": 6, "kind": "element", "displayName": "Resilience4j Configuration", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.model.Resilience4jConfigurationDefinition", "deprecated": false, "autowired": false, "secret": false, "description": "Configures the circuit breaker to use Resilience4j with the given configuration." },
"faultToleranceConfiguration": { "index": 7, "kind": "element", "displayName": "Fault Tolerance Configuration", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.model.FaultToleranceConfigurationDefinition", "deprecated": false, "autowired": false, "secret": false, "description": "Configures the circuit breaker to use MicroProfile Fault Tolerance with the given configuration." },
"onFallback": { "index": 8, "kind": "element", "displayName": "On Fallback", "group": "common", "required": false, "type": "object", "javaType": "org.apache.camel.model.OnFallbackDefinition", "deprecated": false, "autowired": false, "secret": false, "description": "The fallback route path to execute when the circuit breaker triggers." },
- "outputs": { "index": 9, "kind": "element", "displayName": "Outputs", "group": "common", "required": true, "type": "array", "javaType": "java.util.List", "oneOf": [ "a2aSubTask", "aggregate", "bean", "cache", "choice", "circuitBreaker", "claimCheck", "convertBodyTo", "convertHeaderTo", "convertVariableTo", "delay", "doCatch", "doFinally", "doTry", "dynamicRouter", "enrich", "filter", "idempotentConsumer", "intercept", "interceptFrom", "interceptSendToEndpoint", "kamelet", "loadBalance", "log", "loop", "marshal", "multicast", "onCompletion", "onException", "pausable", "pipeline", "policy", "poll", "pollEnrich", "process", "recipientList", "removeHeader", "removeHeaders", "removeProperties", "removeProperty", "removeVariable", "resequence", "resumable", "rollback", "routingSlip", "saga", "sample", "script", "setBody", "setExchangePattern", "setHeader", "setHeaders", "setProperty", "setVariable", "setVariables", "sort", "split", "step", "stop", "threads", "throttle", "throwException", "to", "toD", "tokenizer", "transacted", "transform", "transformDataType", "unmarshal", "validate", "wireTap" ], "deprecated": false, "autowired": false, "secret": false }
+ "outputs": { "index": 9, "kind": "element", "displayName": "Outputs", "group": "common", "required": true, "type": "array", "javaType": "java.util.List", "oneOf": [ "a2aSubTask", "aggregate", "bean", "cache", "choice", "circuitBreaker", "claimCheck", "convertBodyTo", "convertHeaderTo", "convertVariableTo", "delay", "doCatch", "doFinally", "doTry", "dynamicRouter", "enrich", "filter", "idempotentConsumer", "intercept", "interceptFrom", "interceptSendToEndpoint", "kamelet", "loadBalance", "log", "loop", "marshal", "multicast", "onCompletion", "onException", "pausable", "pipeline", "policy", "poll", "pollEnrich", "process", "recipientList", "removeHeader", "removeHeaders", "removeProperties", "removeProperty", "removeVariable", "resequence", "resumable", "rollback", "routingSlip", "saga", "sample", "script", "setBody", "setExchangePattern", "setHeader", "setHeaders", "setProperty", "setVariable", "setVariables", "sort", "split", "step", "stop", "switch", "threads", "throttle", "throwException", "to", "toD", "tokenizer", "transacted", "transform", "transformDataType", "unmarshal", "validate", "wireTap" ], "deprecated": false, "autowired": false, "secret": false }
},
"exchangeProperties": {
"CamelResponseSuccessfulExecution": { "index": 0, "kind": "exchangeProperty", "displayName": "Response Successful Execution", "label": "producer", "required": false, "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "description": "Whether the exchange was processed successfully by the circuit breaker" },
diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/doCatch.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/doCatch.json
index 2ce320d08830f..f71c063b00bde 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/doCatch.json
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/doCatch.json
@@ -18,7 +18,7 @@
"disabled": { "index": 3, "kind": "attribute", "displayName": "Disabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether to disable this EIP from the route during build time. Once an EIP has been disabled then it cannot be enabled later at runtime." },
"exception": { "index": 4, "kind": "element", "displayName": "Exception", "group": "common", "required": false, "type": "array", "javaType": "java.util.List", "deprecated": false, "autowired": false, "secret": false, "description": "The exception class names (fully qualified) to catch." },
"onWhen": { "index": 5, "kind": "element", "displayName": "On When", "group": "common", "required": false, "type": "object", "javaType": "org.apache.camel.model.OnWhenDefinition", "deprecated": false, "autowired": false, "secret": false, "asPredicate": true, "description": "An additional predicate that must evaluate to true for this doCatch to trigger. Allows fine-grained control over which exceptions are caught based on the exchange state." },
- "outputs": { "index": 6, "kind": "element", "displayName": "Outputs", "group": "common", "required": true, "type": "array", "javaType": "java.util.List", "oneOf": [ "a2aSubTask", "aggregate", "bean", "cache", "choice", "circuitBreaker", "claimCheck", "convertBodyTo", "convertHeaderTo", "convertVariableTo", "delay", "doCatch", "doFinally", "doTry", "dynamicRouter", "enrich", "filter", "idempotentConsumer", "intercept", "interceptFrom", "interceptSendToEndpoint", "kamelet", "loadBalance", "log", "loop", "marshal", "multicast", "onCompletion", "onException", "pausable", "pipeline", "policy", "poll", "pollEnrich", "process", "recipientList", "removeHeader", "removeHeaders", "removeProperties", "removeProperty", "removeVariable", "resequence", "resumable", "rollback", "routingSlip", "saga", "sample", "script", "setBody", "setExchangePattern", "setHeader", "setHeaders", "setProperty", "setVariable", "setVariables", "sort", "split", "step", "stop", "threads", "throttle", "throwException", "to", "toD", "tokenizer", "transacted", "transform", "transformDataType", "unmarshal", "validate", "wireTap" ], "deprecated": false, "autowired": false, "secret": false }
+ "outputs": { "index": 6, "kind": "element", "displayName": "Outputs", "group": "common", "required": true, "type": "array", "javaType": "java.util.List", "oneOf": [ "a2aSubTask", "aggregate", "bean", "cache", "choice", "circuitBreaker", "claimCheck", "convertBodyTo", "convertHeaderTo", "convertVariableTo", "delay", "doCatch", "doFinally", "doTry", "dynamicRouter", "enrich", "filter", "idempotentConsumer", "intercept", "interceptFrom", "interceptSendToEndpoint", "kamelet", "loadBalance", "log", "loop", "marshal", "multicast", "onCompletion", "onException", "pausable", "pipeline", "policy", "poll", "pollEnrich", "process", "recipientList", "removeHeader", "removeHeaders", "removeProperties", "removeProperty", "removeVariable", "resequence", "resumable", "rollback", "routingSlip", "saga", "sample", "script", "setBody", "setExchangePattern", "setHeader", "setHeaders", "setProperty", "setVariable", "setVariables", "sort", "split", "step", "stop", "switch", "threads", "throttle", "throwException", "to", "toD", "tokenizer", "transacted", "transform", "transformDataType", "unmarshal", "validate", "wireTap" ], "deprecated": false, "autowired": false, "secret": false }
},
"exchangeProperties": {
"CamelExceptionCaught": { "index": 0, "kind": "exchangeProperty", "displayName": "Exception Caught", "label": "producer", "required": false, "javaType": "java.lang.Exception", "deprecated": false, "autowired": false, "secret": false, "description": "Stores the caught exception due to a processing error of the current Exchange" },
diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/doFinally.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/doFinally.json
index 431f292b84515..015e9389917fb 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/doFinally.json
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/doFinally.json
@@ -16,7 +16,7 @@
"note": { "index": 1, "kind": "attribute", "displayName": "Note", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The note for this node" },
"description": { "index": 2, "kind": "attribute", "displayName": "Description", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The description for this node" },
"disabled": { "index": 3, "kind": "attribute", "displayName": "Disabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether to disable this EIP from the route during build time. Once an EIP has been disabled then it cannot be enabled later at runtime." },
- "outputs": { "index": 4, "kind": "element", "displayName": "Outputs", "group": "common", "required": true, "type": "array", "javaType": "java.util.List", "oneOf": [ "a2aSubTask", "aggregate", "bean", "cache", "choice", "circuitBreaker", "claimCheck", "convertBodyTo", "convertHeaderTo", "convertVariableTo", "delay", "doCatch", "doFinally", "doTry", "dynamicRouter", "enrich", "filter", "idempotentConsumer", "intercept", "interceptFrom", "interceptSendToEndpoint", "kamelet", "loadBalance", "log", "loop", "marshal", "multicast", "onCompletion", "onException", "pausable", "pipeline", "policy", "poll", "pollEnrich", "process", "recipientList", "removeHeader", "removeHeaders", "removeProperties", "removeProperty", "removeVariable", "resequence", "resumable", "rollback", "routingSlip", "saga", "sample", "script", "setBody", "setExchangePattern", "setHeader", "setHeaders", "setProperty", "setVariable", "setVariables", "sort", "split", "step", "stop", "threads", "throttle", "throwException", "to", "toD", "tokenizer", "transacted", "transform", "transformDataType", "unmarshal", "validate", "wireTap" ], "deprecated": false, "autowired": false, "secret": false }
+ "outputs": { "index": 4, "kind": "element", "displayName": "Outputs", "group": "common", "required": true, "type": "array", "javaType": "java.util.List", "oneOf": [ "a2aSubTask", "aggregate", "bean", "cache", "choice", "circuitBreaker", "claimCheck", "convertBodyTo", "convertHeaderTo", "convertVariableTo", "delay", "doCatch", "doFinally", "doTry", "dynamicRouter", "enrich", "filter", "idempotentConsumer", "intercept", "interceptFrom", "interceptSendToEndpoint", "kamelet", "loadBalance", "log", "loop", "marshal", "multicast", "onCompletion", "onException", "pausable", "pipeline", "policy", "poll", "pollEnrich", "process", "recipientList", "removeHeader", "removeHeaders", "removeProperties", "removeProperty", "removeVariable", "resequence", "resumable", "rollback", "routingSlip", "saga", "sample", "script", "setBody", "setExchangePattern", "setHeader", "setHeaders", "setProperty", "setVariable", "setVariables", "sort", "split", "step", "stop", "switch", "threads", "throttle", "throwException", "to", "toD", "tokenizer", "transacted", "transform", "transformDataType", "unmarshal", "validate", "wireTap" ], "deprecated": false, "autowired": false, "secret": false }
},
"exchangeProperties": {
"CamelExceptionCaught": { "index": 0, "kind": "exchangeProperty", "displayName": "Exception Caught", "label": "producer", "required": false, "javaType": "java.lang.Exception", "deprecated": false, "autowired": false, "secret": false, "description": "Stores the caught exception due to a processing error of the current Exchange" },
diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/doTry.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/doTry.json
index 28998908d77aa..1ab592d6688da 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/doTry.json
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/doTry.json
@@ -16,7 +16,7 @@
"note": { "index": 1, "kind": "attribute", "displayName": "Note", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The note for this node" },
"description": { "index": 2, "kind": "attribute", "displayName": "Description", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The description for this node" },
"disabled": { "index": 3, "kind": "attribute", "displayName": "Disabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether to disable this EIP from the route during build time. Once an EIP has been disabled then it cannot be enabled later at runtime." },
- "outputs": { "index": 4, "kind": "element", "displayName": "Outputs", "group": "common", "required": true, "type": "array", "javaType": "java.util.List", "oneOf": [ "a2aSubTask", "aggregate", "bean", "cache", "choice", "circuitBreaker", "claimCheck", "convertBodyTo", "convertHeaderTo", "convertVariableTo", "delay", "doCatch", "doFinally", "doTry", "dynamicRouter", "enrich", "filter", "idempotentConsumer", "intercept", "interceptFrom", "interceptSendToEndpoint", "kamelet", "loadBalance", "log", "loop", "marshal", "multicast", "onCompletion", "onException", "pausable", "pipeline", "policy", "poll", "pollEnrich", "process", "recipientList", "removeHeader", "removeHeaders", "removeProperties", "removeProperty", "removeVariable", "resequence", "resumable", "rollback", "routingSlip", "saga", "sample", "script", "setBody", "setExchangePattern", "setHeader", "setHeaders", "setProperty", "setVariable", "setVariables", "sort", "split", "step", "stop", "threads", "throttle", "throwException", "to", "toD", "tokenizer", "transacted", "transform", "transformDataType", "unmarshal", "validate", "wireTap" ], "deprecated": false, "autowired": false, "secret": false },
+ "outputs": { "index": 4, "kind": "element", "displayName": "Outputs", "group": "common", "required": true, "type": "array", "javaType": "java.util.List", "oneOf": [ "a2aSubTask", "aggregate", "bean", "cache", "choice", "circuitBreaker", "claimCheck", "convertBodyTo", "convertHeaderTo", "convertVariableTo", "delay", "doCatch", "doFinally", "doTry", "dynamicRouter", "enrich", "filter", "idempotentConsumer", "intercept", "interceptFrom", "interceptSendToEndpoint", "kamelet", "loadBalance", "log", "loop", "marshal", "multicast", "onCompletion", "onException", "pausable", "pipeline", "policy", "poll", "pollEnrich", "process", "recipientList", "removeHeader", "removeHeaders", "removeProperties", "removeProperty", "removeVariable", "resequence", "resumable", "rollback", "routingSlip", "saga", "sample", "script", "setBody", "setExchangePattern", "setHeader", "setHeaders", "setProperty", "setVariable", "setVariables", "sort", "split", "step", "stop", "switch", "threads", "throttle", "throwException", "to", "toD", "tokenizer", "transacted", "transform", "transformDataType", "unmarshal", "validate", "wireTap" ], "deprecated": false, "autowired": false, "secret": false },
"doCatch": { "index": 5, "kind": "element", "displayName": "Do Catch", "group": "common", "required": false, "type": "array", "javaType": "java.util.List", "oneOf": [ "doCatch" ], "deprecated": false, "autowired": false, "secret": false, "description": "Catches exceptions as part of a try, catch, finally block" },
"doFinally": { "index": 6, "kind": "element", "displayName": "Do Finally", "group": "common", "required": false, "type": "object", "javaType": "org.apache.camel.model.FinallyDefinition", "deprecated": false, "autowired": false, "secret": false, "description": "Path traversed when a try, catch, finally block exits" }
}
diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/filter.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/filter.json
index c1300ea647c1c..14e7752a5be72 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/filter.json
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/filter.json
@@ -19,6 +19,6 @@
"disabled": { "index": 3, "kind": "attribute", "displayName": "Disabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether to disable this EIP from the route during build time. Once an EIP has been disabled then it cannot be enabled later at runtime." },
"expression": { "index": 4, "kind": "expression", "displayName": "Expression", "group": "common", "required": true, "type": "object", "javaType": "org.apache.camel.model.language.ExpressionDefinition", "oneOf": [ "constant", "datasonnet", "exchangeProperty", "groovy", "header", "hl7terser", "jactl", "java", "jq", "js", "jsonpath", "language", "method", "mvel", "ognl", "python", "python3", "quickjs", "ref", "simple", "spel", "tokenize", "variable", "wasm", "xpath", "xquery", "xtokenize" ], "deprecated": false, "autowired": false, "secret": false, "asPredicate": true, "description": "The predicate expression to evaluate. Messages where the predicate returns false are filtered out and not routed further." },
"statusPropertyName": { "index": 5, "kind": "attribute", "displayName": "Status Property Name", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Name of an exchange property to store whether the filter predicate matched or not. The value is stored as a boolean." },
- "outputs": { "index": 6, "kind": "element", "displayName": "Outputs", "group": "common", "required": true, "type": "array", "javaType": "java.util.List>", "oneOf": [ "a2aSubTask", "aggregate", "bean", "cache", "choice", "circuitBreaker", "claimCheck", "convertBodyTo", "convertHeaderTo", "convertVariableTo", "delay", "doCatch", "doFinally", "doTry", "dynamicRouter", "enrich", "filter", "idempotentConsumer", "intercept", "interceptFrom", "interceptSendToEndpoint", "kamelet", "loadBalance", "log", "loop", "marshal", "multicast", "onCompletion", "onException", "pausable", "pipeline", "policy", "poll", "pollEnrich", "process", "recipientList", "removeHeader", "removeHeaders", "removeProperties", "removeProperty", "removeVariable", "resequence", "resumable", "rollback", "routingSlip", "saga", "sample", "script", "setBody", "setExchangePattern", "setHeader", "setHeaders", "setProperty", "setVariable", "setVariables", "sort", "split", "step", "stop", "threads", "throttle", "throwException", "to", "toD", "tokenizer", "transacted", "transform", "transformDataType", "unmarshal", "validate", "wireTap" ], "deprecated": false, "autowired": false, "secret": false }
+ "outputs": { "index": 6, "kind": "element", "displayName": "Outputs", "group": "common", "required": true, "type": "array", "javaType": "java.util.List>", "oneOf": [ "a2aSubTask", "aggregate", "bean", "cache", "choice", "circuitBreaker", "claimCheck", "convertBodyTo", "convertHeaderTo", "convertVariableTo", "delay", "doCatch", "doFinally", "doTry", "dynamicRouter", "enrich", "filter", "idempotentConsumer", "intercept", "interceptFrom", "interceptSendToEndpoint", "kamelet", "loadBalance", "log", "loop", "marshal", "multicast", "onCompletion", "onException", "pausable", "pipeline", "policy", "poll", "pollEnrich", "process", "recipientList", "removeHeader", "removeHeaders", "removeProperties", "removeProperty", "removeVariable", "resequence", "resumable", "rollback", "routingSlip", "saga", "sample", "script", "setBody", "setExchangePattern", "setHeader", "setHeaders", "setProperty", "setVariable", "setVariables", "sort", "split", "step", "stop", "switch", "threads", "throttle", "throwException", "to", "toD", "tokenizer", "transacted", "transform", "transformDataType", "unmarshal", "validate", "wireTap" ], "deprecated": false, "autowired": false, "secret": false }
}
}
diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/idempotentConsumer.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/idempotentConsumer.json
index ac640cd7983f7..f027166a0bfc3 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/idempotentConsumer.json
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/idempotentConsumer.json
@@ -23,7 +23,7 @@
"completionEager": { "index": 7, "kind": "attribute", "displayName": "Completion Eager", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Sets whether to complete the idempotent consumer eager or when the exchange is done." },
"skipDuplicate": { "index": 8, "kind": "attribute", "displayName": "Skip Duplicate", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Sets whether to skip duplicates or not. The default behavior is to skip duplicates." },
"removeOnFailure": { "index": 9, "kind": "attribute", "displayName": "Remove On Failure", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Sets whether to remove or keep the key on failure. The default behavior is to remove the key on failure." },
- "outputs": { "index": 10, "kind": "element", "displayName": "Outputs", "group": "common", "required": true, "type": "array", "javaType": "java.util.List>", "oneOf": [ "a2aSubTask", "aggregate", "bean", "cache", "choice", "circuitBreaker", "claimCheck", "convertBodyTo", "convertHeaderTo", "convertVariableTo", "delay", "doCatch", "doFinally", "doTry", "dynamicRouter", "enrich", "filter", "idempotentConsumer", "intercept", "interceptFrom", "interceptSendToEndpoint", "kamelet", "loadBalance", "log", "loop", "marshal", "multicast", "onCompletion", "onException", "pausable", "pipeline", "policy", "poll", "pollEnrich", "process", "recipientList", "removeHeader", "removeHeaders", "removeProperties", "removeProperty", "removeVariable", "resequence", "resumable", "rollback", "routingSlip", "saga", "sample", "script", "setBody", "setExchangePattern", "setHeader", "setHeaders", "setProperty", "setVariable", "setVariables", "sort", "split", "step", "stop", "threads", "throttle", "throwException", "to", "toD", "tokenizer", "transacted", "transform", "transformDataType", "unmarshal", "validate", "wireTap" ], "deprecated": false, "autowired": false, "secret": false }
+ "outputs": { "index": 10, "kind": "element", "displayName": "Outputs", "group": "common", "required": true, "type": "array", "javaType": "java.util.List>", "oneOf": [ "a2aSubTask", "aggregate", "bean", "cache", "choice", "circuitBreaker", "claimCheck", "convertBodyTo", "convertHeaderTo", "convertVariableTo", "delay", "doCatch", "doFinally", "doTry", "dynamicRouter", "enrich", "filter", "idempotentConsumer", "intercept", "interceptFrom", "interceptSendToEndpoint", "kamelet", "loadBalance", "log", "loop", "marshal", "multicast", "onCompletion", "onException", "pausable", "pipeline", "policy", "poll", "pollEnrich", "process", "recipientList", "removeHeader", "removeHeaders", "removeProperties", "removeProperty", "removeVariable", "resequence", "resumable", "rollback", "routingSlip", "saga", "sample", "script", "setBody", "setExchangePattern", "setHeader", "setHeaders", "setProperty", "setVariable", "setVariables", "sort", "split", "step", "stop", "switch", "threads", "throttle", "throwException", "to", "toD", "tokenizer", "transacted", "transform", "transformDataType", "unmarshal", "validate", "wireTap" ], "deprecated": false, "autowired": false, "secret": false }
},
"exchangeProperties": {
"CamelDuplicateMessage": { "index": 0, "kind": "exchangeProperty", "displayName": "Duplicate Message", "label": "producer", "required": false, "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "description": "Whether this exchange is a duplicate detected by the Idempotent Consumer EIP" }
diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/intercept.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/intercept.json
index d630b9c923a84..a828928287df4 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/intercept.json
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/intercept.json
@@ -17,7 +17,7 @@
"description": { "index": 2, "kind": "attribute", "displayName": "Description", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The description for this node" },
"disabled": { "index": 3, "kind": "attribute", "displayName": "Disabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether to disable this EIP from the route during build time. Once an EIP has been disabled then it cannot be enabled later at runtime." },
"onWhen": { "index": 4, "kind": "element", "displayName": "On When", "group": "common", "required": false, "type": "object", "javaType": "org.apache.camel.model.OnWhenDefinition", "deprecated": false, "autowired": false, "secret": false, "asPredicate": true, "description": "To use an expression to only trigger intercepting in specific situations" },
- "outputs": { "index": 5, "kind": "element", "displayName": "Outputs", "group": "common", "required": true, "type": "array", "javaType": "java.util.List", "oneOf": [ "a2aSubTask", "aggregate", "bean", "cache", "choice", "circuitBreaker", "claimCheck", "convertBodyTo", "convertHeaderTo", "convertVariableTo", "delay", "doCatch", "doFinally", "doTry", "dynamicRouter", "enrich", "filter", "idempotentConsumer", "intercept", "interceptFrom", "interceptSendToEndpoint", "kamelet", "loadBalance", "log", "loop", "marshal", "multicast", "onCompletion", "onException", "pausable", "pipeline", "policy", "poll", "pollEnrich", "process", "recipientList", "removeHeader", "removeHeaders", "removeProperties", "removeProperty", "removeVariable", "resequence", "resumable", "rollback", "routingSlip", "saga", "sample", "script", "setBody", "setExchangePattern", "setHeader", "setHeaders", "setProperty", "setVariable", "setVariables", "sort", "split", "step", "stop", "threads", "throttle", "throwException", "to", "toD", "tokenizer", "transacted", "transform", "transformDataType", "unmarshal", "validate", "wireTap" ], "deprecated": false, "autowired": false, "secret": false }
+ "outputs": { "index": 5, "kind": "element", "displayName": "Outputs", "group": "common", "required": true, "type": "array", "javaType": "java.util.List", "oneOf": [ "a2aSubTask", "aggregate", "bean", "cache", "choice", "circuitBreaker", "claimCheck", "convertBodyTo", "convertHeaderTo", "convertVariableTo", "delay", "doCatch", "doFinally", "doTry", "dynamicRouter", "enrich", "filter", "idempotentConsumer", "intercept", "interceptFrom", "interceptSendToEndpoint", "kamelet", "loadBalance", "log", "loop", "marshal", "multicast", "onCompletion", "onException", "pausable", "pipeline", "policy", "poll", "pollEnrich", "process", "recipientList", "removeHeader", "removeHeaders", "removeProperties", "removeProperty", "removeVariable", "resequence", "resumable", "rollback", "routingSlip", "saga", "sample", "script", "setBody", "setExchangePattern", "setHeader", "setHeaders", "setProperty", "setVariable", "setVariables", "sort", "split", "step", "stop", "switch", "threads", "throttle", "throwException", "to", "toD", "tokenizer", "transacted", "transform", "transformDataType", "unmarshal", "validate", "wireTap" ], "deprecated": false, "autowired": false, "secret": false }
},
"exchangeProperties": {
"CamelInterceptedNodeId": { "index": 0, "kind": "exchangeProperty", "displayName": "Intercepted Node Id", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "autowired": false, "secret": false, "description": "The intercepted route's node ID" },
diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/interceptFrom.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/interceptFrom.json
index 799330919f7a6..0e1c4ff4c2706 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/interceptFrom.json
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/interceptFrom.json
@@ -18,7 +18,7 @@
"disabled": { "index": 3, "kind": "attribute", "displayName": "Disabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether to disable this EIP from the route during build time. Once an EIP has been disabled then it cannot be enabled later at runtime." },
"uri": { "index": 4, "kind": "attribute", "displayName": "Uri", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Intercept incoming messages from the uri or uri pattern. If not configured, then all incoming messages are intercepted." },
"onWhen": { "index": 5, "kind": "element", "displayName": "On When", "group": "common", "required": false, "type": "object", "javaType": "org.apache.camel.model.OnWhenDefinition", "deprecated": false, "autowired": false, "secret": false, "asPredicate": true, "description": "To use an expression to only trigger intercepting in specific situations" },
- "outputs": { "index": 6, "kind": "element", "displayName": "Outputs", "group": "common", "required": true, "type": "array", "javaType": "java.util.List", "oneOf": [ "a2aSubTask", "aggregate", "bean", "cache", "choice", "circuitBreaker", "claimCheck", "convertBodyTo", "convertHeaderTo", "convertVariableTo", "delay", "doCatch", "doFinally", "doTry", "dynamicRouter", "enrich", "filter", "idempotentConsumer", "intercept", "interceptFrom", "interceptSendToEndpoint", "kamelet", "loadBalance", "log", "loop", "marshal", "multicast", "onCompletion", "onException", "pausable", "pipeline", "policy", "poll", "pollEnrich", "process", "recipientList", "removeHeader", "removeHeaders", "removeProperties", "removeProperty", "removeVariable", "resequence", "resumable", "rollback", "routingSlip", "saga", "sample", "script", "setBody", "setExchangePattern", "setHeader", "setHeaders", "setProperty", "setVariable", "setVariables", "sort", "split", "step", "stop", "threads", "throttle", "throwException", "to", "toD", "tokenizer", "transacted", "transform", "transformDataType", "unmarshal", "validate", "wireTap" ], "deprecated": false, "autowired": false, "secret": false }
+ "outputs": { "index": 6, "kind": "element", "displayName": "Outputs", "group": "common", "required": true, "type": "array", "javaType": "java.util.List", "oneOf": [ "a2aSubTask", "aggregate", "bean", "cache", "choice", "circuitBreaker", "claimCheck", "convertBodyTo", "convertHeaderTo", "convertVariableTo", "delay", "doCatch", "doFinally", "doTry", "dynamicRouter", "enrich", "filter", "idempotentConsumer", "intercept", "interceptFrom", "interceptSendToEndpoint", "kamelet", "loadBalance", "log", "loop", "marshal", "multicast", "onCompletion", "onException", "pausable", "pipeline", "policy", "poll", "pollEnrich", "process", "recipientList", "removeHeader", "removeHeaders", "removeProperties", "removeProperty", "removeVariable", "resequence", "resumable", "rollback", "routingSlip", "saga", "sample", "script", "setBody", "setExchangePattern", "setHeader", "setHeaders", "setProperty", "setVariable", "setVariables", "sort", "split", "step", "stop", "switch", "threads", "throttle", "throwException", "to", "toD", "tokenizer", "transacted", "transform", "transformDataType", "unmarshal", "validate", "wireTap" ], "deprecated": false, "autowired": false, "secret": false }
},
"exchangeProperties": {
"CamelInterceptedEndpoint": { "index": 0, "kind": "exchangeProperty", "displayName": "Intercepted Endpoint", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "autowired": false, "secret": false, "description": "The endpoint URI that was intercepted" },
diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/interceptSendToEndpoint.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/interceptSendToEndpoint.json
index 45ed39b6cbfb8..98f5399696b87 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/interceptSendToEndpoint.json
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/interceptSendToEndpoint.json
@@ -20,7 +20,7 @@
"skipSendToOriginalEndpoint": { "index": 5, "kind": "attribute", "displayName": "Skip Send To Original Endpoint", "group": "common", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether to skip sending the message to the original endpoint. By default, the message is both intercepted and then sent to the original endpoint." },
"afterUri": { "index": 6, "kind": "attribute", "displayName": "After Uri", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "After sending to the endpoint then send the message to this uri which allows to process its result." },
"onWhen": { "index": 7, "kind": "element", "displayName": "On When", "group": "common", "required": false, "type": "object", "javaType": "org.apache.camel.model.OnWhenDefinition", "deprecated": false, "autowired": false, "secret": false, "asPredicate": true, "description": "To use an expression to only trigger intercepting sending to an endpoint in specific situations" },
- "outputs": { "index": 8, "kind": "element", "displayName": "Outputs", "group": "common", "required": true, "type": "array", "javaType": "java.util.List", "oneOf": [ "a2aSubTask", "aggregate", "bean", "cache", "choice", "circuitBreaker", "claimCheck", "convertBodyTo", "convertHeaderTo", "convertVariableTo", "delay", "doCatch", "doFinally", "doTry", "dynamicRouter", "enrich", "filter", "idempotentConsumer", "intercept", "interceptFrom", "interceptSendToEndpoint", "kamelet", "loadBalance", "log", "loop", "marshal", "multicast", "onCompletion", "onException", "pausable", "pipeline", "policy", "poll", "pollEnrich", "process", "recipientList", "removeHeader", "removeHeaders", "removeProperties", "removeProperty", "removeVariable", "resequence", "resumable", "rollback", "routingSlip", "saga", "sample", "script", "setBody", "setExchangePattern", "setHeader", "setHeaders", "setProperty", "setVariable", "setVariables", "sort", "split", "step", "stop", "threads", "throttle", "throwException", "to", "toD", "tokenizer", "transacted", "transform", "transformDataType", "unmarshal", "validate", "wireTap" ], "deprecated": false, "autowired": false, "secret": false }
+ "outputs": { "index": 8, "kind": "element", "displayName": "Outputs", "group": "common", "required": true, "type": "array", "javaType": "java.util.List", "oneOf": [ "a2aSubTask", "aggregate", "bean", "cache", "choice", "circuitBreaker", "claimCheck", "convertBodyTo", "convertHeaderTo", "convertVariableTo", "delay", "doCatch", "doFinally", "doTry", "dynamicRouter", "enrich", "filter", "idempotentConsumer", "intercept", "interceptFrom", "interceptSendToEndpoint", "kamelet", "loadBalance", "log", "loop", "marshal", "multicast", "onCompletion", "onException", "pausable", "pipeline", "policy", "poll", "pollEnrich", "process", "recipientList", "removeHeader", "removeHeaders", "removeProperties", "removeProperty", "removeVariable", "resequence", "resumable", "rollback", "routingSlip", "saga", "sample", "script", "setBody", "setExchangePattern", "setHeader", "setHeaders", "setProperty", "setVariable", "setVariables", "sort", "split", "step", "stop", "switch", "threads", "throttle", "throwException", "to", "toD", "tokenizer", "transacted", "transform", "transformDataType", "unmarshal", "validate", "wireTap" ], "deprecated": false, "autowired": false, "secret": false }
},
"exchangeProperties": {
"CamelInterceptedEndpoint": { "index": 0, "kind": "exchangeProperty", "displayName": "Intercepted Endpoint", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "autowired": false, "secret": false, "description": "The endpoint URI that was intercepted" },
diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/kamelet.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/kamelet.json
index cd8c43e1beacc..1d0749b2d5e10 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/kamelet.json
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/kamelet.json
@@ -17,6 +17,6 @@
"description": { "index": 2, "kind": "attribute", "displayName": "Description", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The description for this node" },
"disabled": { "index": 3, "kind": "attribute", "displayName": "Disabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether to disable this EIP from the route during build time. Once an EIP has been disabled then it cannot be enabled later at runtime." },
"name": { "index": 4, "kind": "attribute", "displayName": "Name", "group": "common", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Name of the Kamelet (templateId\/routeId) to call. Options for the kamelet can be specified using uri syntax, eg mynamecount=4&type=gold." },
- "outputs": { "index": 5, "kind": "element", "displayName": "Outputs", "group": "common", "required": true, "type": "array", "javaType": "java.util.List", "oneOf": [ "a2aSubTask", "aggregate", "bean", "cache", "choice", "circuitBreaker", "claimCheck", "convertBodyTo", "convertHeaderTo", "convertVariableTo", "delay", "doCatch", "doFinally", "doTry", "dynamicRouter", "enrich", "filter", "idempotentConsumer", "intercept", "interceptFrom", "interceptSendToEndpoint", "kamelet", "loadBalance", "log", "loop", "marshal", "multicast", "onCompletion", "onException", "pausable", "pipeline", "policy", "poll", "pollEnrich", "process", "recipientList", "removeHeader", "removeHeaders", "removeProperties", "removeProperty", "removeVariable", "resequence", "resumable", "rollback", "routingSlip", "saga", "sample", "script", "setBody", "setExchangePattern", "setHeader", "setHeaders", "setProperty", "setVariable", "setVariables", "sort", "split", "step", "stop", "threads", "throttle", "throwException", "to", "toD", "tokenizer", "transacted", "transform", "transformDataType", "unmarshal", "validate", "wireTap" ], "deprecated": false, "autowired": false, "secret": false }
+ "outputs": { "index": 5, "kind": "element", "displayName": "Outputs", "group": "common", "required": true, "type": "array", "javaType": "java.util.List", "oneOf": [ "a2aSubTask", "aggregate", "bean", "cache", "choice", "circuitBreaker", "claimCheck", "convertBodyTo", "convertHeaderTo", "convertVariableTo", "delay", "doCatch", "doFinally", "doTry", "dynamicRouter", "enrich", "filter", "idempotentConsumer", "intercept", "interceptFrom", "interceptSendToEndpoint", "kamelet", "loadBalance", "log", "loop", "marshal", "multicast", "onCompletion", "onException", "pausable", "pipeline", "policy", "poll", "pollEnrich", "process", "recipientList", "removeHeader", "removeHeaders", "removeProperties", "removeProperty", "removeVariable", "resequence", "resumable", "rollback", "routingSlip", "saga", "sample", "script", "setBody", "setExchangePattern", "setHeader", "setHeaders", "setProperty", "setVariable", "setVariables", "sort", "split", "step", "stop", "switch", "threads", "throttle", "throwException", "to", "toD", "tokenizer", "transacted", "transform", "transformDataType", "unmarshal", "validate", "wireTap" ], "deprecated": false, "autowired": false, "secret": false }
}
}
diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/loadBalance.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/loadBalance.json
index de65c909bd967..29654577a69fb 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/loadBalance.json
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/loadBalance.json
@@ -18,6 +18,6 @@
"description": { "index": 2, "kind": "attribute", "displayName": "Description", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The description for this node" },
"disabled": { "index": 3, "kind": "attribute", "displayName": "Disabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether to disable this EIP from the route during build time. Once an EIP has been disabled then it cannot be enabled later at runtime." },
"loadBalancerType": { "index": 4, "kind": "element", "displayName": "Load Balancer Type", "group": "common", "required": true, "type": "object", "javaType": "org.apache.camel.model.LoadBalancerDefinition", "oneOf": [ "customLoadBalancer", "failoverLoadBalancer", "randomLoadBalancer", "roundRobinLoadBalancer", "stickyLoadBalancer", "topicLoadBalancer", "weightedLoadBalancer" ], "deprecated": false, "autowired": false, "secret": false, "description": "The load balancing strategy to use, such as round-robin, random, sticky, topic, failover, weighted, or a custom load balancer." },
- "outputs": { "index": 5, "kind": "element", "displayName": "Outputs", "group": "common", "required": true, "type": "array", "javaType": "java.util.List", "oneOf": [ "a2aSubTask", "aggregate", "bean", "cache", "choice", "circuitBreaker", "claimCheck", "convertBodyTo", "convertHeaderTo", "convertVariableTo", "delay", "doCatch", "doFinally", "doTry", "dynamicRouter", "enrich", "filter", "idempotentConsumer", "intercept", "interceptFrom", "interceptSendToEndpoint", "kamelet", "loadBalance", "log", "loop", "marshal", "multicast", "onCompletion", "onException", "pausable", "pipeline", "policy", "poll", "pollEnrich", "process", "recipientList", "removeHeader", "removeHeaders", "removeProperties", "removeProperty", "removeVariable", "resequence", "resumable", "rollback", "routingSlip", "saga", "sample", "script", "setBody", "setExchangePattern", "setHeader", "setHeaders", "setProperty", "setVariable", "setVariables", "sort", "split", "step", "stop", "threads", "throttle", "throwException", "to", "toD", "tokenizer", "transacted", "transform", "transformDataType", "unmarshal", "validate", "wireTap" ], "deprecated": false, "autowired": false, "secret": false }
+ "outputs": { "index": 5, "kind": "element", "displayName": "Outputs", "group": "common", "required": true, "type": "array", "javaType": "java.util.List", "oneOf": [ "a2aSubTask", "aggregate", "bean", "cache", "choice", "circuitBreaker", "claimCheck", "convertBodyTo", "convertHeaderTo", "convertVariableTo", "delay", "doCatch", "doFinally", "doTry", "dynamicRouter", "enrich", "filter", "idempotentConsumer", "intercept", "interceptFrom", "interceptSendToEndpoint", "kamelet", "loadBalance", "log", "loop", "marshal", "multicast", "onCompletion", "onException", "pausable", "pipeline", "policy", "poll", "pollEnrich", "process", "recipientList", "removeHeader", "removeHeaders", "removeProperties", "removeProperty", "removeVariable", "resequence", "resumable", "rollback", "routingSlip", "saga", "sample", "script", "setBody", "setExchangePattern", "setHeader", "setHeaders", "setProperty", "setVariable", "setVariables", "sort", "split", "step", "stop", "switch", "threads", "throttle", "throwException", "to", "toD", "tokenizer", "transacted", "transform", "transformDataType", "unmarshal", "validate", "wireTap" ], "deprecated": false, "autowired": false, "secret": false }
}
}
diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/loop.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/loop.json
index 333d1d3cad860..08cffb3e6a881 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/loop.json
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/loop.json
@@ -22,7 +22,7 @@
"doWhile": { "index": 6, "kind": "attribute", "displayName": "Do While", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Enables the while loop that loops until the predicate evaluates to false or null." },
"breakOnShutdown": { "index": 7, "kind": "attribute", "displayName": "Break On Shutdown", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "If enabled, the loop will not iterate until it reaches the end when Camel is shut down." },
"onPrepare": { "index": 8, "kind": "attribute", "displayName": "On Prepare", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.Processor", "deprecated": false, "autowired": false, "secret": false, "description": "Uses a processor when preparing the exchange for each loop iteration. This can be used to deep-clone messages, or any custom logic needed before the looping executes." },
- "outputs": { "index": 9, "kind": "element", "displayName": "Outputs", "group": "common", "required": true, "type": "array", "javaType": "java.util.List>", "oneOf": [ "a2aSubTask", "aggregate", "bean", "cache", "choice", "circuitBreaker", "claimCheck", "convertBodyTo", "convertHeaderTo", "convertVariableTo", "delay", "doCatch", "doFinally", "doTry", "dynamicRouter", "enrich", "filter", "idempotentConsumer", "intercept", "interceptFrom", "interceptSendToEndpoint", "kamelet", "loadBalance", "log", "loop", "marshal", "multicast", "onCompletion", "onException", "pausable", "pipeline", "policy", "poll", "pollEnrich", "process", "recipientList", "removeHeader", "removeHeaders", "removeProperties", "removeProperty", "removeVariable", "resequence", "resumable", "rollback", "routingSlip", "saga", "sample", "script", "setBody", "setExchangePattern", "setHeader", "setHeaders", "setProperty", "setVariable", "setVariables", "sort", "split", "step", "stop", "threads", "throttle", "throwException", "to", "toD", "tokenizer", "transacted", "transform", "transformDataType", "unmarshal", "validate", "wireTap" ], "deprecated": false, "autowired": false, "secret": false }
+ "outputs": { "index": 9, "kind": "element", "displayName": "Outputs", "group": "common", "required": true, "type": "array", "javaType": "java.util.List>", "oneOf": [ "a2aSubTask", "aggregate", "bean", "cache", "choice", "circuitBreaker", "claimCheck", "convertBodyTo", "convertHeaderTo", "convertVariableTo", "delay", "doCatch", "doFinally", "doTry", "dynamicRouter", "enrich", "filter", "idempotentConsumer", "intercept", "interceptFrom", "interceptSendToEndpoint", "kamelet", "loadBalance", "log", "loop", "marshal", "multicast", "onCompletion", "onException", "pausable", "pipeline", "policy", "poll", "pollEnrich", "process", "recipientList", "removeHeader", "removeHeaders", "removeProperties", "removeProperty", "removeVariable", "resequence", "resumable", "rollback", "routingSlip", "saga", "sample", "script", "setBody", "setExchangePattern", "setHeader", "setHeaders", "setProperty", "setVariable", "setVariables", "sort", "split", "step", "stop", "switch", "threads", "throttle", "throwException", "to", "toD", "tokenizer", "transacted", "transform", "transformDataType", "unmarshal", "validate", "wireTap" ], "deprecated": false, "autowired": false, "secret": false }
},
"exchangeProperties": {
"CamelLoopIndex": { "index": 0, "kind": "exchangeProperty", "displayName": "Loop Index", "label": "producer", "required": false, "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "description": "Index of the current iteration (0 based)." },
diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/multicast.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/multicast.json
index 37d9cd457cd2c..29f44c5b3e1c4 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/multicast.json
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/multicast.json
@@ -29,7 +29,7 @@
"executorService": { "index": 13, "kind": "attribute", "displayName": "Executor Service", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "java.util.concurrent.ExecutorService", "deprecated": false, "autowired": false, "secret": false, "description": "Reference to a custom thread pool to use for parallel processing. Setting this option implies parallel processing." },
"onPrepare": { "index": 14, "kind": "attribute", "displayName": "On Prepare", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.Processor", "deprecated": false, "autowired": false, "secret": false, "description": "Reference to a processor for preparing the exchange to be sent. Can be used to deep-clone messages that should be sent." },
"shareUnitOfWork": { "index": 15, "kind": "attribute", "displayName": "Share Unit Of Work", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Shares the unit of work with the parent and each of the multicast exchanges. By default each multicast exchange has its own individual unit of work." },
- "outputs": { "index": 16, "kind": "element", "displayName": "Outputs", "group": "common", "required": true, "type": "array", "javaType": "java.util.List", "oneOf": [ "a2aSubTask", "aggregate", "bean", "cache", "choice", "circuitBreaker", "claimCheck", "convertBodyTo", "convertHeaderTo", "convertVariableTo", "delay", "doCatch", "doFinally", "doTry", "dynamicRouter", "enrich", "filter", "idempotentConsumer", "intercept", "interceptFrom", "interceptSendToEndpoint", "kamelet", "loadBalance", "log", "loop", "marshal", "multicast", "onCompletion", "onException", "pausable", "pipeline", "policy", "poll", "pollEnrich", "process", "recipientList", "removeHeader", "removeHeaders", "removeProperties", "removeProperty", "removeVariable", "resequence", "resumable", "rollback", "routingSlip", "saga", "sample", "script", "setBody", "setExchangePattern", "setHeader", "setHeaders", "setProperty", "setVariable", "setVariables", "sort", "split", "step", "stop", "threads", "throttle", "throwException", "to", "toD", "tokenizer", "transacted", "transform", "transformDataType", "unmarshal", "validate", "wireTap" ], "deprecated": false, "autowired": false, "secret": false }
+ "outputs": { "index": 16, "kind": "element", "displayName": "Outputs", "group": "common", "required": true, "type": "array", "javaType": "java.util.List", "oneOf": [ "a2aSubTask", "aggregate", "bean", "cache", "choice", "circuitBreaker", "claimCheck", "convertBodyTo", "convertHeaderTo", "convertVariableTo", "delay", "doCatch", "doFinally", "doTry", "dynamicRouter", "enrich", "filter", "idempotentConsumer", "intercept", "interceptFrom", "interceptSendToEndpoint", "kamelet", "loadBalance", "log", "loop", "marshal", "multicast", "onCompletion", "onException", "pausable", "pipeline", "policy", "poll", "pollEnrich", "process", "recipientList", "removeHeader", "removeHeaders", "removeProperties", "removeProperty", "removeVariable", "resequence", "resumable", "rollback", "routingSlip", "saga", "sample", "script", "setBody", "setExchangePattern", "setHeader", "setHeaders", "setProperty", "setVariable", "setVariables", "sort", "split", "step", "stop", "switch", "threads", "throttle", "throwException", "to", "toD", "tokenizer", "transacted", "transform", "transformDataType", "unmarshal", "validate", "wireTap" ], "deprecated": false, "autowired": false, "secret": false }
},
"exchangeProperties": {
"CamelMulticastIndex": { "index": 0, "kind": "exchangeProperty", "displayName": "Multicast Index", "label": "producer", "required": false, "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "description": "An index counter that increases for each Exchange being multicasted. The counter starts from 0." },
diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/onCompletion.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/onCompletion.json
index ffb6fa48a43d9..262a77cea7fc1 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/onCompletion.json
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/onCompletion.json
@@ -23,7 +23,7 @@
"executorService": { "index": 8, "kind": "attribute", "displayName": "Executor Service", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "java.util.concurrent.ExecutorService", "deprecated": false, "autowired": false, "secret": false, "description": "Refers to a custom Thread Pool to be used for parallel processing. Notice if you set this option, then parallel processing is automatically implied, and you do not have to enable that option as well." },
"useOriginalMessage": { "index": 9, "kind": "attribute", "displayName": "Use Original Message", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Will use the original input message when an Exchange for this on completion. By default this feature is off." },
"onWhen": { "index": 10, "kind": "element", "displayName": "On When", "group": "common", "required": false, "type": "object", "javaType": "org.apache.camel.model.OnWhenDefinition", "deprecated": false, "autowired": false, "secret": false, "asPredicate": true, "description": "To use an expression to only trigger routing this completion steps in specific situations" },
- "outputs": { "index": 11, "kind": "element", "displayName": "Outputs", "group": "common", "required": true, "type": "array", "javaType": "java.util.List", "oneOf": [ "a2aSubTask", "aggregate", "bean", "cache", "choice", "circuitBreaker", "claimCheck", "convertBodyTo", "convertHeaderTo", "convertVariableTo", "delay", "doCatch", "doFinally", "doTry", "dynamicRouter", "enrich", "filter", "idempotentConsumer", "intercept", "interceptFrom", "interceptSendToEndpoint", "kamelet", "loadBalance", "log", "loop", "marshal", "multicast", "onCompletion", "onException", "pausable", "pipeline", "policy", "poll", "pollEnrich", "process", "recipientList", "removeHeader", "removeHeaders", "removeProperties", "removeProperty", "removeVariable", "resequence", "resumable", "rollback", "routingSlip", "saga", "sample", "script", "setBody", "setExchangePattern", "setHeader", "setHeaders", "setProperty", "setVariable", "setVariables", "sort", "split", "step", "stop", "threads", "throttle", "throwException", "to", "toD", "tokenizer", "transacted", "transform", "transformDataType", "unmarshal", "validate", "wireTap" ], "deprecated": false, "autowired": false, "secret": false }
+ "outputs": { "index": 11, "kind": "element", "displayName": "Outputs", "group": "common", "required": true, "type": "array", "javaType": "java.util.List", "oneOf": [ "a2aSubTask", "aggregate", "bean", "cache", "choice", "circuitBreaker", "claimCheck", "convertBodyTo", "convertHeaderTo", "convertVariableTo", "delay", "doCatch", "doFinally", "doTry", "dynamicRouter", "enrich", "filter", "idempotentConsumer", "intercept", "interceptFrom", "interceptSendToEndpoint", "kamelet", "loadBalance", "log", "loop", "marshal", "multicast", "onCompletion", "onException", "pausable", "pipeline", "policy", "poll", "pollEnrich", "process", "recipientList", "removeHeader", "removeHeaders", "removeProperties", "removeProperty", "removeVariable", "resequence", "resumable", "rollback", "routingSlip", "saga", "sample", "script", "setBody", "setExchangePattern", "setHeader", "setHeaders", "setProperty", "setVariable", "setVariables", "sort", "split", "step", "stop", "switch", "threads", "throttle", "throwException", "to", "toD", "tokenizer", "transacted", "transform", "transformDataType", "unmarshal", "validate", "wireTap" ], "deprecated": false, "autowired": false, "secret": false }
},
"exchangeProperties": {
"CamelOnCompletion": { "index": 0, "kind": "exchangeProperty", "displayName": "On Completion", "label": "producer", "required": false, "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "description": "Flag to mark that this exchange is currently being executed as onCompletion" }
diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/onException.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/onException.json
index 886d297162cbe..e0ed0003e5046 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/onException.json
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/onException.json
@@ -27,7 +27,7 @@
"onExceptionOccurredRef": { "index": 12, "kind": "attribute", "displayName": "On Exception Occurred Ref", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Sets a reference to a processor that is invoked just after an exception occurred. Can be used to perform custom logging. Any exception thrown from this processor is ignored." },
"useOriginalMessage": { "index": 13, "kind": "attribute", "displayName": "Use Original Message", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "If enabled, uses the original input message (body and headers) when the exchange is moved to the dead letter queue after all redelivery attempts have been exhausted. Cannot be used together with useOriginalBody." },
"useOriginalBody": { "index": 14, "kind": "attribute", "displayName": "Use Original Body", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "If enabled, uses the original input message body (but not headers) when the exchange is moved to the dead letter queue after all redelivery attempts have been exhausted. This allows enriching the message with custom headers while keeping the original body. Cannot be used together with useOriginalMessage." },
- "outputs": { "index": 15, "kind": "element", "displayName": "Outputs", "group": "common", "required": true, "type": "array", "javaType": "java.util.List", "oneOf": [ "a2aSubTask", "aggregate", "bean", "cache", "choice", "circuitBreaker", "claimCheck", "convertBodyTo", "convertHeaderTo", "convertVariableTo", "delay", "doCatch", "doFinally", "doTry", "dynamicRouter", "enrich", "filter", "idempotentConsumer", "intercept", "interceptFrom", "interceptSendToEndpoint", "kamelet", "loadBalance", "log", "loop", "marshal", "multicast", "onCompletion", "onException", "pausable", "pipeline", "policy", "poll", "pollEnrich", "process", "recipientList", "removeHeader", "removeHeaders", "removeProperties", "removeProperty", "removeVariable", "resequence", "resumable", "rollback", "routingSlip", "saga", "sample", "script", "setBody", "setExchangePattern", "setHeader", "setHeaders", "setProperty", "setVariable", "setVariables", "sort", "split", "step", "stop", "threads", "throttle", "throwException", "to", "toD", "tokenizer", "transacted", "transform", "transformDataType", "unmarshal", "validate", "wireTap" ], "deprecated": false, "autowired": false, "secret": false }
+ "outputs": { "index": 15, "kind": "element", "displayName": "Outputs", "group": "common", "required": true, "type": "array", "javaType": "java.util.List", "oneOf": [ "a2aSubTask", "aggregate", "bean", "cache", "choice", "circuitBreaker", "claimCheck", "convertBodyTo", "convertHeaderTo", "convertVariableTo", "delay", "doCatch", "doFinally", "doTry", "dynamicRouter", "enrich", "filter", "idempotentConsumer", "intercept", "interceptFrom", "interceptSendToEndpoint", "kamelet", "loadBalance", "log", "loop", "marshal", "multicast", "onCompletion", "onException", "pausable", "pipeline", "policy", "poll", "pollEnrich", "process", "recipientList", "removeHeader", "removeHeaders", "removeProperties", "removeProperty", "removeVariable", "resequence", "resumable", "rollback", "routingSlip", "saga", "sample", "script", "setBody", "setExchangePattern", "setHeader", "setHeaders", "setProperty", "setVariable", "setVariables", "sort", "split", "step", "stop", "switch", "threads", "throttle", "throwException", "to", "toD", "tokenizer", "transacted", "transform", "transformDataType", "unmarshal", "validate", "wireTap" ], "deprecated": false, "autowired": false, "secret": false }
},
"exchangeProperties": {
"CamelExceptionCaught": { "index": 0, "kind": "exchangeProperty", "displayName": "Exception Caught", "label": "producer", "required": false, "javaType": "java.lang.Exception", "deprecated": false, "autowired": false, "secret": false, "description": "Stores the caught exception due to a processing error of the current Exchange" },
diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/onFallback.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/onFallback.json
index fda944929370d..839e56088a003 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/onFallback.json
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/onFallback.json
@@ -17,6 +17,6 @@
"note": { "index": 1, "kind": "attribute", "displayName": "Note", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The note for this node" },
"description": { "index": 2, "kind": "attribute", "displayName": "Description", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The description for this node" },
"fallbackViaNetwork": { "index": 3, "kind": "attribute", "displayName": "Fallback Via Network", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": true, "deprecationNote": "Not supported by any circuit breaker implementation.", "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the fallback goes over the network. If so, the fallback is executed on a separate thread-pool to avoid exhausting the main thread-pool." },
- "outputs": { "index": 4, "kind": "element", "displayName": "Outputs", "group": "common", "required": true, "type": "array", "javaType": "java.util.List>", "oneOf": [ "a2aSubTask", "aggregate", "bean", "cache", "choice", "circuitBreaker", "claimCheck", "convertBodyTo", "convertHeaderTo", "convertVariableTo", "delay", "doCatch", "doFinally", "doTry", "dynamicRouter", "enrich", "filter", "idempotentConsumer", "intercept", "interceptFrom", "interceptSendToEndpoint", "kamelet", "loadBalance", "log", "loop", "marshal", "multicast", "onCompletion", "onException", "pausable", "pipeline", "policy", "poll", "pollEnrich", "process", "recipientList", "removeHeader", "removeHeaders", "removeProperties", "removeProperty", "removeVariable", "resequence", "resumable", "rollback", "routingSlip", "saga", "sample", "script", "setBody", "setExchangePattern", "setHeader", "setHeaders", "setProperty", "setVariable", "setVariables", "sort", "split", "step", "stop", "threads", "throttle", "throwException", "to", "toD", "tokenizer", "transacted", "transform", "transformDataType", "unmarshal", "validate", "wireTap" ], "deprecated": false, "autowired": false, "secret": false }
+ "outputs": { "index": 4, "kind": "element", "displayName": "Outputs", "group": "common", "required": true, "type": "array", "javaType": "java.util.List>", "oneOf": [ "a2aSubTask", "aggregate", "bean", "cache", "choice", "circuitBreaker", "claimCheck", "convertBodyTo", "convertHeaderTo", "convertVariableTo", "delay", "doCatch", "doFinally", "doTry", "dynamicRouter", "enrich", "filter", "idempotentConsumer", "intercept", "interceptFrom", "interceptSendToEndpoint", "kamelet", "loadBalance", "log", "loop", "marshal", "multicast", "onCompletion", "onException", "pausable", "pipeline", "policy", "poll", "pollEnrich", "process", "recipientList", "removeHeader", "removeHeaders", "removeProperties", "removeProperty", "removeVariable", "resequence", "resumable", "rollback", "routingSlip", "saga", "sample", "script", "setBody", "setExchangePattern", "setHeader", "setHeaders", "setProperty", "setVariable", "setVariables", "sort", "split", "step", "stop", "switch", "threads", "throttle", "throwException", "to", "toD", "tokenizer", "transacted", "transform", "transformDataType", "unmarshal", "validate", "wireTap" ], "deprecated": false, "autowired": false, "secret": false }
}
}
diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/otherwise.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/otherwise.json
index 201bd53c297c5..41494913752ff 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/otherwise.json
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/otherwise.json
@@ -16,6 +16,6 @@
"note": { "index": 1, "kind": "attribute", "displayName": "Note", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The note for this node" },
"description": { "index": 2, "kind": "attribute", "displayName": "Description", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The description for this node" },
"disabled": { "index": 3, "kind": "attribute", "displayName": "Disabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Disables this EIP from the route." },
- "outputs": { "index": 4, "kind": "element", "displayName": "Outputs", "group": "common", "required": true, "type": "array", "javaType": "java.util.List>", "oneOf": [ "a2aSubTask", "aggregate", "bean", "cache", "choice", "circuitBreaker", "claimCheck", "convertBodyTo", "convertHeaderTo", "convertVariableTo", "delay", "doCatch", "doFinally", "doTry", "dynamicRouter", "enrich", "filter", "idempotentConsumer", "intercept", "interceptFrom", "interceptSendToEndpoint", "kamelet", "loadBalance", "log", "loop", "marshal", "multicast", "onCompletion", "onException", "pausable", "pipeline", "policy", "poll", "pollEnrich", "process", "recipientList", "removeHeader", "removeHeaders", "removeProperties", "removeProperty", "removeVariable", "resequence", "resumable", "rollback", "routingSlip", "saga", "sample", "script", "setBody", "setExchangePattern", "setHeader", "setHeaders", "setProperty", "setVariable", "setVariables", "sort", "split", "step", "stop", "threads", "throttle", "throwException", "to", "toD", "tokenizer", "transacted", "transform", "transformDataType", "unmarshal", "validate", "wireTap" ], "deprecated": false, "autowired": false, "secret": false }
+ "outputs": { "index": 4, "kind": "element", "displayName": "Outputs", "group": "common", "required": true, "type": "array", "javaType": "java.util.List>", "oneOf": [ "a2aSubTask", "aggregate", "bean", "cache", "choice", "circuitBreaker", "claimCheck", "convertBodyTo", "convertHeaderTo", "convertVariableTo", "delay", "doCatch", "doFinally", "doTry", "dynamicRouter", "enrich", "filter", "idempotentConsumer", "intercept", "interceptFrom", "interceptSendToEndpoint", "kamelet", "loadBalance", "log", "loop", "marshal", "multicast", "onCompletion", "onException", "pausable", "pipeline", "policy", "poll", "pollEnrich", "process", "recipientList", "removeHeader", "removeHeaders", "removeProperties", "removeProperty", "removeVariable", "resequence", "resumable", "rollback", "routingSlip", "saga", "sample", "script", "setBody", "setExchangePattern", "setHeader", "setHeaders", "setProperty", "setVariable", "setVariables", "sort", "split", "step", "stop", "switch", "threads", "throttle", "throwException", "to", "toD", "tokenizer", "transacted", "transform", "transformDataType", "unmarshal", "validate", "wireTap" ], "deprecated": false, "autowired": false, "secret": false }
}
}
diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/pipeline.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/pipeline.json
index 8c2e503fed5c7..3c5106ddb4855 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/pipeline.json
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/pipeline.json
@@ -17,6 +17,6 @@
"note": { "index": 1, "kind": "attribute", "displayName": "Note", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The note for this node" },
"description": { "index": 2, "kind": "attribute", "displayName": "Description", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The description for this node" },
"disabled": { "index": 3, "kind": "attribute", "displayName": "Disabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether to disable this EIP from the route during build time. Once an EIP has been disabled then it cannot be enabled later at runtime." },
- "outputs": { "index": 4, "kind": "element", "displayName": "Outputs", "group": "common", "required": true, "type": "array", "javaType": "java.util.List", "oneOf": [ "a2aSubTask", "aggregate", "bean", "cache", "choice", "circuitBreaker", "claimCheck", "convertBodyTo", "convertHeaderTo", "convertVariableTo", "delay", "doCatch", "doFinally", "doTry", "dynamicRouter", "enrich", "filter", "idempotentConsumer", "intercept", "interceptFrom", "interceptSendToEndpoint", "kamelet", "loadBalance", "log", "loop", "marshal", "multicast", "onCompletion", "onException", "pausable", "pipeline", "policy", "poll", "pollEnrich", "process", "recipientList", "removeHeader", "removeHeaders", "removeProperties", "removeProperty", "removeVariable", "resequence", "resumable", "rollback", "routingSlip", "saga", "sample", "script", "setBody", "setExchangePattern", "setHeader", "setHeaders", "setProperty", "setVariable", "setVariables", "sort", "split", "step", "stop", "threads", "throttle", "throwException", "to", "toD", "tokenizer", "transacted", "transform", "transformDataType", "unmarshal", "validate", "wireTap" ], "deprecated": false, "autowired": false, "secret": false }
+ "outputs": { "index": 4, "kind": "element", "displayName": "Outputs", "group": "common", "required": true, "type": "array", "javaType": "java.util.List", "oneOf": [ "a2aSubTask", "aggregate", "bean", "cache", "choice", "circuitBreaker", "claimCheck", "convertBodyTo", "convertHeaderTo", "convertVariableTo", "delay", "doCatch", "doFinally", "doTry", "dynamicRouter", "enrich", "filter", "idempotentConsumer", "intercept", "interceptFrom", "interceptSendToEndpoint", "kamelet", "loadBalance", "log", "loop", "marshal", "multicast", "onCompletion", "onException", "pausable", "pipeline", "policy", "poll", "pollEnrich", "process", "recipientList", "removeHeader", "removeHeaders", "removeProperties", "removeProperty", "removeVariable", "resequence", "resumable", "rollback", "routingSlip", "saga", "sample", "script", "setBody", "setExchangePattern", "setHeader", "setHeaders", "setProperty", "setVariable", "setVariables", "sort", "split", "step", "stop", "switch", "threads", "throttle", "throwException", "to", "toD", "tokenizer", "transacted", "transform", "transformDataType", "unmarshal", "validate", "wireTap" ], "deprecated": false, "autowired": false, "secret": false }
}
}
diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/resequence.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/resequence.json
index 7cc32a64df664..a001f1f6d674c 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/resequence.json
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/resequence.json
@@ -18,6 +18,6 @@
"disabled": { "index": 3, "kind": "attribute", "displayName": "Disabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether to disable this EIP from the route during build time. Once an EIP has been disabled then it cannot be enabled later at runtime." },
"expression": { "index": 4, "kind": "expression", "displayName": "Expression", "group": "common", "required": true, "type": "object", "javaType": "org.apache.camel.model.language.ExpressionDefinition", "oneOf": [ "constant", "datasonnet", "exchangeProperty", "groovy", "header", "hl7terser", "jactl", "java", "jq", "js", "jsonpath", "language", "method", "mvel", "ognl", "python", "python3", "quickjs", "ref", "simple", "spel", "tokenize", "variable", "wasm", "xpath", "xquery", "xtokenize" ], "deprecated": false, "autowired": false, "secret": false, "description": "Expression to use for re-ordering the messages, such as a header with a sequence number." },
"resequencerConfig": { "index": 5, "kind": "element", "displayName": "Resequencer Config", "group": "common", "required": true, "type": "object", "javaType": "org.apache.camel.model.config.ResequencerConfig", "oneOf": [ "batchConfig", "streamConfig" ], "deprecated": false, "autowired": false, "secret": false, "description": "Resequencer configuration using either batch or stream mode. Defaults to batch mode." },
- "outputs": { "index": 6, "kind": "element", "displayName": "Outputs", "group": "common", "required": true, "type": "array", "javaType": "java.util.List", "oneOf": [ "a2aSubTask", "aggregate", "bean", "cache", "choice", "circuitBreaker", "claimCheck", "convertBodyTo", "convertHeaderTo", "convertVariableTo", "delay", "doCatch", "doFinally", "doTry", "dynamicRouter", "enrich", "filter", "idempotentConsumer", "intercept", "interceptFrom", "interceptSendToEndpoint", "kamelet", "loadBalance", "log", "loop", "marshal", "multicast", "onCompletion", "onException", "pausable", "pipeline", "policy", "poll", "pollEnrich", "process", "recipientList", "removeHeader", "removeHeaders", "removeProperties", "removeProperty", "removeVariable", "resequence", "resumable", "rollback", "routingSlip", "saga", "sample", "script", "setBody", "setExchangePattern", "setHeader", "setHeaders", "setProperty", "setVariable", "setVariables", "sort", "split", "step", "stop", "threads", "throttle", "throwException", "to", "toD", "tokenizer", "transacted", "transform", "transformDataType", "unmarshal", "validate", "wireTap" ], "deprecated": false, "autowired": false, "secret": false }
+ "outputs": { "index": 6, "kind": "element", "displayName": "Outputs", "group": "common", "required": true, "type": "array", "javaType": "java.util.List", "oneOf": [ "a2aSubTask", "aggregate", "bean", "cache", "choice", "circuitBreaker", "claimCheck", "convertBodyTo", "convertHeaderTo", "convertVariableTo", "delay", "doCatch", "doFinally", "doTry", "dynamicRouter", "enrich", "filter", "idempotentConsumer", "intercept", "interceptFrom", "interceptSendToEndpoint", "kamelet", "loadBalance", "log", "loop", "marshal", "multicast", "onCompletion", "onException", "pausable", "pipeline", "policy", "poll", "pollEnrich", "process", "recipientList", "removeHeader", "removeHeaders", "removeProperties", "removeProperty", "removeVariable", "resequence", "resumable", "rollback", "routingSlip", "saga", "sample", "script", "setBody", "setExchangePattern", "setHeader", "setHeaders", "setProperty", "setVariable", "setVariables", "sort", "split", "step", "stop", "switch", "threads", "throttle", "throwException", "to", "toD", "tokenizer", "transacted", "transform", "transformDataType", "unmarshal", "validate", "wireTap" ], "deprecated": false, "autowired": false, "secret": false }
}
}
diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/route.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/route.json
index 16356d0e9ad39..ad5d3453d0f70 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/route.json
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/route.json
@@ -34,6 +34,6 @@
"inputType": { "index": 19, "kind": "element", "displayName": "Input Type", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.model.InputTypeDefinition", "deprecated": false, "autowired": false, "secret": false, "description": "Declare the expected data type of the input message. If the actual message type is different at runtime, camel looks for a required Transformer and applies if exists." },
"outputType": { "index": 20, "kind": "element", "displayName": "Output Type", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.model.OutputTypeDefinition", "deprecated": false, "autowired": false, "secret": false, "description": "Declare the expected data type of the output message. If the actual message type is different at runtime, camel looks for a required Transformer and applies if exists." },
"input": { "index": 21, "kind": "element", "displayName": "Input", "group": "common", "required": true, "type": "object", "javaType": "org.apache.camel.model.FromDefinition", "oneOf": [ "from" ], "deprecated": false, "autowired": false, "secret": false, "description": "The input (from) endpoint that starts this route and acts as the consumer that receives incoming messages." },
- "outputs": { "index": 22, "kind": "element", "displayName": "Outputs", "group": "common", "required": true, "type": "array", "javaType": "java.util.List>", "oneOf": [ "a2aSubTask", "aggregate", "bean", "cache", "choice", "circuitBreaker", "claimCheck", "convertBodyTo", "convertHeaderTo", "convertVariableTo", "delay", "doCatch", "doFinally", "doTry", "dynamicRouter", "enrich", "filter", "idempotentConsumer", "intercept", "interceptFrom", "interceptSendToEndpoint", "kamelet", "loadBalance", "log", "loop", "marshal", "multicast", "onCompletion", "onException", "pausable", "pipeline", "policy", "poll", "pollEnrich", "process", "recipientList", "removeHeader", "removeHeaders", "removeProperties", "removeProperty", "removeVariable", "resequence", "resumable", "rollback", "routingSlip", "saga", "sample", "script", "setBody", "setExchangePattern", "setHeader", "setHeaders", "setProperty", "setVariable", "setVariables", "sort", "split", "step", "stop", "threads", "throttle", "throwException", "to", "toD", "tokenizer", "transacted", "transform", "transformDataType", "unmarshal", "validate", "wireTap" ], "deprecated": false, "autowired": false, "secret": false }
+ "outputs": { "index": 22, "kind": "element", "displayName": "Outputs", "group": "common", "required": true, "type": "array", "javaType": "java.util.List>", "oneOf": [ "a2aSubTask", "aggregate", "bean", "cache", "choice", "circuitBreaker", "claimCheck", "convertBodyTo", "convertHeaderTo", "convertVariableTo", "delay", "doCatch", "doFinally", "doTry", "dynamicRouter", "enrich", "filter", "idempotentConsumer", "intercept", "interceptFrom", "interceptSendToEndpoint", "kamelet", "loadBalance", "log", "loop", "marshal", "multicast", "onCompletion", "onException", "pausable", "pipeline", "policy", "poll", "pollEnrich", "process", "recipientList", "removeHeader", "removeHeaders", "removeProperties", "removeProperty", "removeVariable", "resequence", "resumable", "rollback", "routingSlip", "saga", "sample", "script", "setBody", "setExchangePattern", "setHeader", "setHeaders", "setProperty", "setVariable", "setVariables", "sort", "split", "step", "stop", "switch", "threads", "throttle", "throwException", "to", "toD", "tokenizer", "transacted", "transform", "transformDataType", "unmarshal", "validate", "wireTap" ], "deprecated": false, "autowired": false, "secret": false }
}
}
diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/saga.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/saga.json
index 0ea9948ae92c6..de47ff1502019 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/saga.json
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/saga.json
@@ -24,6 +24,6 @@
"compensation": { "index": 8, "kind": "attribute", "displayName": "Compensation", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The compensation endpoint URI that must be called to compensate all changes done in the route. The route corresponding to the compensation URI must perform compensation and complete without error." },
"completion": { "index": 9, "kind": "attribute", "displayName": "Completion", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The completion endpoint URI that will be called when the Saga is completed successfully. The route corresponding to the completion URI must perform completion tasks and terminate without error." },
"option": { "index": 10, "kind": "element", "displayName": "Option", "group": "advanced", "label": "advanced", "required": false, "type": "array", "javaType": "java.util.List", "deprecated": false, "autowired": false, "secret": false, "description": "Allows to save properties of the current exchange in order to re-use them in a compensation\/completion callback route. Option values will be transformed into input headers of the compensation\/completion exchange." },
- "outputs": { "index": 11, "kind": "element", "displayName": "Outputs", "group": "common", "required": true, "type": "array", "javaType": "java.util.List", "oneOf": [ "a2aSubTask", "aggregate", "bean", "cache", "choice", "circuitBreaker", "claimCheck", "convertBodyTo", "convertHeaderTo", "convertVariableTo", "delay", "doCatch", "doFinally", "doTry", "dynamicRouter", "enrich", "filter", "idempotentConsumer", "intercept", "interceptFrom", "interceptSendToEndpoint", "kamelet", "loadBalance", "log", "loop", "marshal", "multicast", "onCompletion", "onException", "pausable", "pipeline", "policy", "poll", "pollEnrich", "process", "recipientList", "removeHeader", "removeHeaders", "removeProperties", "removeProperty", "removeVariable", "resequence", "resumable", "rollback", "routingSlip", "saga", "sample", "script", "setBody", "setExchangePattern", "setHeader", "setHeaders", "setProperty", "setVariable", "setVariables", "sort", "split", "step", "stop", "threads", "throttle", "throwException", "to", "toD", "tokenizer", "transacted", "transform", "transformDataType", "unmarshal", "validate", "wireTap" ], "deprecated": false, "autowired": false, "secret": false }
+ "outputs": { "index": 11, "kind": "element", "displayName": "Outputs", "group": "common", "required": true, "type": "array", "javaType": "java.util.List", "oneOf": [ "a2aSubTask", "aggregate", "bean", "cache", "choice", "circuitBreaker", "claimCheck", "convertBodyTo", "convertHeaderTo", "convertVariableTo", "delay", "doCatch", "doFinally", "doTry", "dynamicRouter", "enrich", "filter", "idempotentConsumer", "intercept", "interceptFrom", "interceptSendToEndpoint", "kamelet", "loadBalance", "log", "loop", "marshal", "multicast", "onCompletion", "onException", "pausable", "pipeline", "policy", "poll", "pollEnrich", "process", "recipientList", "removeHeader", "removeHeaders", "removeProperties", "removeProperty", "removeVariable", "resequence", "resumable", "rollback", "routingSlip", "saga", "sample", "script", "setBody", "setExchangePattern", "setHeader", "setHeaders", "setProperty", "setVariable", "setVariables", "sort", "split", "step", "stop", "switch", "threads", "throttle", "throwException", "to", "toD", "tokenizer", "transacted", "transform", "transformDataType", "unmarshal", "validate", "wireTap" ], "deprecated": false, "autowired": false, "secret": false }
}
}
diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/split.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/split.json
index ca0c9e4909a8f..9ac5f17714ad1 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/split.json
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/split.json
@@ -37,7 +37,7 @@
"resumeStrategy": { "index": 21, "kind": "attribute", "displayName": "Resume Strategy", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.resume.ResumeStrategy", "deprecated": false, "autowired": false, "secret": false, "description": "Sets a ResumeStrategy for resume-from-last-position support. The watermark key must also be configured via watermarkKey(String) ." },
"watermarkKey": { "index": 22, "kind": "attribute", "displayName": "Watermark Key", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Sets the key to use in the watermark store." },
"watermarkExpression": { "index": 23, "kind": "attribute", "displayName": "Watermark Expression", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Sets a Simple expression to evaluate on each completed sub-exchange to determine the new watermark value. When set, enables value-based watermarking instead of index-based. The expression is evaluated using the Simple language." },
- "outputs": { "index": 24, "kind": "element", "displayName": "Outputs", "group": "common", "required": true, "type": "array", "javaType": "java.util.List>", "oneOf": [ "a2aSubTask", "aggregate", "bean", "cache", "choice", "circuitBreaker", "claimCheck", "convertBodyTo", "convertHeaderTo", "convertVariableTo", "delay", "doCatch", "doFinally", "doTry", "dynamicRouter", "enrich", "filter", "idempotentConsumer", "intercept", "interceptFrom", "interceptSendToEndpoint", "kamelet", "loadBalance", "log", "loop", "marshal", "multicast", "onCompletion", "onException", "pausable", "pipeline", "policy", "poll", "pollEnrich", "process", "recipientList", "removeHeader", "removeHeaders", "removeProperties", "removeProperty", "removeVariable", "resequence", "resumable", "rollback", "routingSlip", "saga", "sample", "script", "setBody", "setExchangePattern", "setHeader", "setHeaders", "setProperty", "setVariable", "setVariables", "sort", "split", "step", "stop", "threads", "throttle", "throwException", "to", "toD", "tokenizer", "transacted", "transform", "transformDataType", "unmarshal", "validate", "wireTap" ], "deprecated": false, "autowired": false, "secret": false }
+ "outputs": { "index": 24, "kind": "element", "displayName": "Outputs", "group": "common", "required": true, "type": "array", "javaType": "java.util.List>", "oneOf": [ "a2aSubTask", "aggregate", "bean", "cache", "choice", "circuitBreaker", "claimCheck", "convertBodyTo", "convertHeaderTo", "convertVariableTo", "delay", "doCatch", "doFinally", "doTry", "dynamicRouter", "enrich", "filter", "idempotentConsumer", "intercept", "interceptFrom", "interceptSendToEndpoint", "kamelet", "loadBalance", "log", "loop", "marshal", "multicast", "onCompletion", "onException", "pausable", "pipeline", "policy", "poll", "pollEnrich", "process", "recipientList", "removeHeader", "removeHeaders", "removeProperties", "removeProperty", "removeVariable", "resequence", "resumable", "rollback", "routingSlip", "saga", "sample", "script", "setBody", "setExchangePattern", "setHeader", "setHeaders", "setProperty", "setVariable", "setVariables", "sort", "split", "step", "stop", "switch", "threads", "throttle", "throwException", "to", "toD", "tokenizer", "transacted", "transform", "transformDataType", "unmarshal", "validate", "wireTap" ], "deprecated": false, "autowired": false, "secret": false }
},
"exchangeProperties": {
"CamelSplitIndex": { "index": 0, "kind": "exchangeProperty", "displayName": "Split Index", "label": "producer", "required": false, "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "important": true, "description": "A split counter that increases for each Exchange being split. The counter starts from 0." },
diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/step.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/step.json
index 4b05956cb882d..710b522ee3010 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/step.json
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/step.json
@@ -16,7 +16,7 @@
"note": { "index": 1, "kind": "attribute", "displayName": "Note", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The note for this node" },
"description": { "index": 2, "kind": "attribute", "displayName": "Description", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The description for this node" },
"disabled": { "index": 3, "kind": "attribute", "displayName": "Disabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether to disable this EIP from the route during build time. Once an EIP has been disabled then it cannot be enabled later at runtime." },
- "outputs": { "index": 4, "kind": "element", "displayName": "Outputs", "group": "common", "required": true, "type": "array", "javaType": "java.util.List", "oneOf": [ "a2aSubTask", "aggregate", "bean", "cache", "choice", "circuitBreaker", "claimCheck", "convertBodyTo", "convertHeaderTo", "convertVariableTo", "delay", "doCatch", "doFinally", "doTry", "dynamicRouter", "enrich", "filter", "idempotentConsumer", "intercept", "interceptFrom", "interceptSendToEndpoint", "kamelet", "loadBalance", "log", "loop", "marshal", "multicast", "onCompletion", "onException", "pausable", "pipeline", "policy", "poll", "pollEnrich", "process", "recipientList", "removeHeader", "removeHeaders", "removeProperties", "removeProperty", "removeVariable", "resequence", "resumable", "rollback", "routingSlip", "saga", "sample", "script", "setBody", "setExchangePattern", "setHeader", "setHeaders", "setProperty", "setVariable", "setVariables", "sort", "split", "step", "stop", "threads", "throttle", "throwException", "to", "toD", "tokenizer", "transacted", "transform", "transformDataType", "unmarshal", "validate", "wireTap" ], "deprecated": false, "autowired": false, "secret": false }
+ "outputs": { "index": 4, "kind": "element", "displayName": "Outputs", "group": "common", "required": true, "type": "array", "javaType": "java.util.List", "oneOf": [ "a2aSubTask", "aggregate", "bean", "cache", "choice", "circuitBreaker", "claimCheck", "convertBodyTo", "convertHeaderTo", "convertVariableTo", "delay", "doCatch", "doFinally", "doTry", "dynamicRouter", "enrich", "filter", "idempotentConsumer", "intercept", "interceptFrom", "interceptSendToEndpoint", "kamelet", "loadBalance", "log", "loop", "marshal", "multicast", "onCompletion", "onException", "pausable", "pipeline", "policy", "poll", "pollEnrich", "process", "recipientList", "removeHeader", "removeHeaders", "removeProperties", "removeProperty", "removeVariable", "resequence", "resumable", "rollback", "routingSlip", "saga", "sample", "script", "setBody", "setExchangePattern", "setHeader", "setHeaders", "setProperty", "setVariable", "setVariables", "sort", "split", "step", "stop", "switch", "threads", "throttle", "throwException", "to", "toD", "tokenizer", "transacted", "transform", "transformDataType", "unmarshal", "validate", "wireTap" ], "deprecated": false, "autowired": false, "secret": false }
},
"exchangeProperties": {
"CamelStepId": { "index": 0, "kind": "exchangeProperty", "displayName": "Step Id", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "autowired": false, "secret": false, "description": "The id of the Step EIP" }
diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/switch.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/switch.json
new file mode 100644
index 0000000000000..1da2d69acf5ba
--- /dev/null
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/switch.json
@@ -0,0 +1,24 @@
+{
+ "model": {
+ "kind": "model",
+ "name": "switch",
+ "title": "Switch",
+ "description": "Evaluates a selector once and dispatches to a fixed endpoint by literal scalar values",
+ "deprecated": false,
+ "firstVersion": "4.23.0",
+ "label": "eip,routing",
+ "javaType": "org.apache.camel.model.SwitchDefinition",
+ "abstract": false,
+ "input": true,
+ "output": false
+ },
+ "properties": {
+ "id": { "index": 0, "kind": "attribute", "displayName": "Id", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The id of this node" },
+ "note": { "index": 1, "kind": "attribute", "displayName": "Note", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The note for this node" },
+ "description": { "index": 2, "kind": "attribute", "displayName": "Description", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The description for this node" },
+ "disabled": { "index": 3, "kind": "attribute", "displayName": "Disabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether to disable this EIP from the route during build time. Once an EIP has been disabled then it cannot be enabled later at runtime." },
+ "selector": { "index": 4, "kind": "expression", "displayName": "Selector", "group": "common", "required": true, "type": "object", "javaType": "org.apache.camel.model.ExpressionSubElementDefinition", "oneOf": [ "constant", "datasonnet", "exchangeProperty", "groovy", "header", "hl7terser", "jactl", "java", "jq", "js", "jsonpath", "language", "method", "mvel", "ognl", "python", "python3", "quickjs", "ref", "simple", "spel", "tokenize", "variable", "wasm", "xpath", "xquery", "xtokenize" ], "deprecated": false, "autowired": false, "secret": false, "description": "Expression evaluated once per entry. Returns a scalar value to match against the literal cases." },
+ "case": { "index": 5, "kind": "element", "displayName": "Case", "group": "common", "required": false, "type": "array", "javaType": "java.util.List", "deprecated": false, "autowired": false, "secret": false, "description": "Literal cases. Duplicate values are rejected at startup, ignoring case." },
+ "otherwise": { "index": 6, "kind": "element", "displayName": "Otherwise", "group": "common", "required": false, "type": "object", "javaType": "org.apache.camel.model.SwitchOtherwiseDefinition", "oneOf": [ "otherwise" ], "deprecated": false, "autowired": false, "secret": false, "description": "Fixed fallback URI for null or unmatched selector results. Without a fallback processing continues." }
+ }
+}
diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/switchOtherwise.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/switchOtherwise.json
new file mode 100644
index 0000000000000..ef34bee1569a8
--- /dev/null
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/switchOtherwise.json
@@ -0,0 +1,17 @@
+{
+ "model": {
+ "kind": "model",
+ "name": "switchOtherwise",
+ "title": "Switch Otherwise",
+ "description": "The fixed endpoint used when no switch case matches",
+ "deprecated": false,
+ "label": "configuration",
+ "javaType": "org.apache.camel.model.SwitchOtherwiseDefinition",
+ "abstract": false,
+ "input": false,
+ "output": false
+ },
+ "properties": {
+ "uri": { "index": 0, "kind": "attribute", "displayName": "Uri", "group": "common", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The fixed destination URI. Supports property placeholders, but not Simple expressions." }
+ }
+}
diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/when.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/when.json
index e04a77617a656..44b0e97480e41 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/when.json
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/when.json
@@ -17,6 +17,6 @@
"description": { "index": 2, "kind": "attribute", "displayName": "Description", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The description for this node" },
"disabled": { "index": 3, "kind": "attribute", "displayName": "Disabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Disables this EIP from the route." },
"expression": { "index": 4, "kind": "expression", "displayName": "Expression", "group": "common", "required": true, "type": "object", "javaType": "org.apache.camel.model.language.ExpressionDefinition", "oneOf": [ "constant", "datasonnet", "exchangeProperty", "groovy", "header", "hl7terser", "jactl", "java", "jq", "js", "jsonpath", "language", "method", "mvel", "ognl", "python", "python3", "quickjs", "ref", "simple", "spel", "tokenize", "variable", "wasm", "xpath", "xquery", "xtokenize" ], "deprecated": false, "autowired": false, "secret": false, "asPredicate": true, "description": "Expression used as the predicate to evaluate whether this when should trigger and route the message or not." },
- "outputs": { "index": 5, "kind": "element", "displayName": "Outputs", "group": "common", "required": true, "type": "array", "javaType": "java.util.List>", "oneOf": [ "a2aSubTask", "aggregate", "bean", "cache", "choice", "circuitBreaker", "claimCheck", "convertBodyTo", "convertHeaderTo", "convertVariableTo", "delay", "doCatch", "doFinally", "doTry", "dynamicRouter", "enrich", "filter", "idempotentConsumer", "intercept", "interceptFrom", "interceptSendToEndpoint", "kamelet", "loadBalance", "log", "loop", "marshal", "multicast", "onCompletion", "onException", "pausable", "pipeline", "policy", "poll", "pollEnrich", "process", "recipientList", "removeHeader", "removeHeaders", "removeProperties", "removeProperty", "removeVariable", "resequence", "resumable", "rollback", "routingSlip", "saga", "sample", "script", "setBody", "setExchangePattern", "setHeader", "setHeaders", "setProperty", "setVariable", "setVariables", "sort", "split", "step", "stop", "threads", "throttle", "throwException", "to", "toD", "tokenizer", "transacted", "transform", "transformDataType", "unmarshal", "validate", "wireTap" ], "deprecated": false, "autowired": false, "secret": false }
+ "outputs": { "index": 5, "kind": "element", "displayName": "Outputs", "group": "common", "required": true, "type": "array", "javaType": "java.util.List>", "oneOf": [ "a2aSubTask", "aggregate", "bean", "cache", "choice", "circuitBreaker", "claimCheck", "convertBodyTo", "convertHeaderTo", "convertVariableTo", "delay", "doCatch", "doFinally", "doTry", "dynamicRouter", "enrich", "filter", "idempotentConsumer", "intercept", "interceptFrom", "interceptSendToEndpoint", "kamelet", "loadBalance", "log", "loop", "marshal", "multicast", "onCompletion", "onException", "pausable", "pipeline", "policy", "poll", "pollEnrich", "process", "recipientList", "removeHeader", "removeHeaders", "removeProperties", "removeProperty", "removeVariable", "resequence", "resumable", "rollback", "routingSlip", "saga", "sample", "script", "setBody", "setExchangePattern", "setHeader", "setHeaders", "setProperty", "setVariable", "setVariables", "sort", "split", "step", "stop", "switch", "threads", "throttle", "throwException", "to", "toD", "tokenizer", "transacted", "transform", "transformDataType", "unmarshal", "validate", "wireTap" ], "deprecated": false, "autowired": false, "secret": false }
}
}
diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/schemas/camel-spring.xsd b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/schemas/camel-spring.xsd
index ac1f0016ee7c6..8a2094f0800be 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/schemas/camel-spring.xsd
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/schemas/camel-spring.xsd
@@ -173,6 +173,15 @@ configuration
+
+
+
+
+
+
+
@@ -2000,6 +2009,24 @@ Encode and decode SWIFT MT messages
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -3171,6 +3198,7 @@ configuration.
+
@@ -3385,6 +3413,7 @@ values.
+
@@ -4043,6 +4072,7 @@ Whether the script should support using Camel property placeholder syntax {{ }}.
+
@@ -4164,6 +4194,7 @@ The exception class names (fully qualified) to catch.
+
@@ -4332,6 +4363,7 @@ placeholders or simple expressions using only property placeholders are supporte
+
@@ -4423,6 +4455,7 @@ Disables this EIP from the route. Default value: false
+
@@ -4516,6 +4549,7 @@ Disables this EIP from the route. Default value: false
+
@@ -5019,6 +5053,7 @@ References a custom thread pool to use when offloading a guarded action to anoth
+
@@ -6138,6 +6173,7 @@ The logging level to use for logging transactional rollback. Default is WARN. De
+
@@ -6229,6 +6265,7 @@ Name of an exchange property to store whether the filter predicate matched or no
+
@@ -6393,6 +6430,7 @@ Global option value.
+
@@ -6549,6 +6587,7 @@ Whether validation is required for this input type. Default value: false
+
@@ -6648,6 +6687,7 @@ Intercept incoming messages from the uri or uri pattern. If not configured, then
+
@@ -6758,6 +6798,7 @@ After sending to the endpoint then send the message to this uri which allows to
+
@@ -6859,6 +6900,7 @@ mynamecount=4&type=gold.
+
@@ -7188,6 +7230,7 @@ The language to use for evaluating the log message, such as simple, groovy, or o
+
@@ -10944,6 +10987,7 @@ gigabyte. Set to -1 to disable setting a maximum decompressed size. Default valu
+
@@ -11147,6 +11191,7 @@ own individual unit of work. Default value: false
+
@@ -11333,6 +11378,7 @@ onException steps complete. The exception is considered handled as well.
+
@@ -11546,6 +11592,7 @@ Predicate to evaluate whether the processing can resume. Returns true if consump
+
@@ -11628,6 +11675,7 @@ Predicate to evaluate whether the processing can resume. Returns true if consump
+
@@ -12295,6 +12343,7 @@ Name of the variable to remove.
+
@@ -12654,6 +12703,7 @@ Reference to the routes in the xml-dsl.
+
@@ -13052,6 +13102,7 @@ Option values will be transformed into input headers of the compensation/complet
+
@@ -13557,6 +13608,7 @@ Sets a reference to lookup for the comparator to use for sorting.
+
@@ -13833,6 +13885,7 @@ enables value-based watermarking instead of index-based. The expression is evalu
+
@@ -13858,6 +13911,73 @@ enables value-based watermarking instead of index-based. The expression is evalu
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -14557,6 +14677,7 @@ The underlying model name used by the tokenizer. Providing this switches to comp
+
@@ -14711,6 +14832,7 @@ into.
+
diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/schemas/camel-xml-io.xsd b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/schemas/camel-xml-io.xsd
index c35e47ebc6bf5..d925ea5aeaeee 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/schemas/camel-xml-io.xsd
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/schemas/camel-xml-io.xsd
@@ -155,6 +155,15 @@ miss, executes the block and caches the result body.
+
+
+
+
+
+
+
@@ -1829,6 +1838,24 @@ Encode and decode SWIFT MT messages
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -2281,6 +2308,7 @@ Compression and decompress streams using java.util.zip.Zip*Stream
+
@@ -2495,6 +2523,7 @@ values.
+
@@ -3153,6 +3182,7 @@ Whether the script should support using Camel property placeholder syntax {{ }}.
+
@@ -3274,6 +3304,7 @@ The exception class names (fully qualified) to catch.
+
@@ -3442,6 +3473,7 @@ placeholders or simple expressions using only property placeholders are supporte
+
@@ -3533,6 +3565,7 @@ Disables this EIP from the route. Default value: false
+
@@ -3626,6 +3659,7 @@ Disables this EIP from the route. Default value: false
+
@@ -4141,6 +4175,7 @@ References a custom thread pool to use when offloading a guarded action to anoth
+
@@ -5260,6 +5295,7 @@ The logging level to use for logging transactional rollback. Default is WARN. De
+
@@ -5351,6 +5387,7 @@ Name of an exchange property to store whether the filter predicate matched or no
+
@@ -5515,6 +5552,7 @@ Global option value.
+
@@ -5671,6 +5709,7 @@ Whether validation is required for this input type. Default value: false
+
@@ -5770,6 +5809,7 @@ Intercept incoming messages from the uri or uri pattern. If not configured, then
+
@@ -5880,6 +5920,7 @@ After sending to the endpoint then send the message to this uri which allows to
+
@@ -5981,6 +6022,7 @@ mynamecount=4&type=gold.
+
@@ -6310,6 +6352,7 @@ The language to use for evaluating the log message, such as simple, groovy, or o
+
@@ -10066,6 +10109,7 @@ gigabyte. Set to -1 to disable setting a maximum decompressed size. Default valu
+
@@ -10269,6 +10313,7 @@ own individual unit of work. Default value: false
+
@@ -10455,6 +10500,7 @@ onException steps complete. The exception is considered handled as well.
+
@@ -10668,6 +10714,7 @@ Predicate to evaluate whether the processing can resume. Returns true if consump
+
@@ -10750,6 +10797,7 @@ Predicate to evaluate whether the processing can resume. Returns true if consump
+
@@ -11438,6 +11486,7 @@ Name of the variable to remove.
+
@@ -11797,6 +11846,7 @@ Reference to the routes in the xml-dsl.
+
@@ -12195,6 +12245,7 @@ Option values will be transformed into input headers of the compensation/complet
+
@@ -12700,6 +12751,7 @@ Sets a reference to lookup for the comparator to use for sorting.
+
@@ -12976,6 +13028,7 @@ enables value-based watermarking instead of index-based. The expression is evalu
+
@@ -13001,6 +13054,73 @@ enables value-based watermarking instead of index-based. The expression is evalu
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -13700,6 +13820,7 @@ The underlying model name used by the tokenizer. Providing this switches to comp
+
@@ -13854,6 +13975,7 @@ into.
+
diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/schemas/camelYamlDsl-model.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/schemas/camelYamlDsl-model.json
index f8c769681a031..d14e31756b498 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/schemas/camelYamlDsl-model.json
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/schemas/camelYamlDsl-model.json
@@ -505,6 +505,13 @@
"title" : "Stop",
"description" : "Stops processing of the current message and marks the exchange as completed without sending it to any further steps",
"label" : "eip,flowcontrol,routing"
+ }, {
+ "name" : "switch",
+ "type" : "object",
+ "ref" : "switch",
+ "title" : "Switch",
+ "description" : "Evaluates a selector once and dispatches to a fixed endpoint by literal scalar values",
+ "label" : "eip,routing"
}, {
"name" : "threads",
"type" : "object",
@@ -8323,6 +8330,137 @@
"label" : "advanced"
} ]
},
+ "switchCase" : {
+ "title" : "Case",
+ "description" : "A literal switch case with one fixed endpoint destination",
+ "children" : [ {
+ "name" : "description",
+ "type" : "string",
+ "description" : "The description for this node",
+ "title" : "Description"
+ }, {
+ "name" : "id",
+ "type" : "string",
+ "description" : "The id of this node",
+ "title" : "Id"
+ }, {
+ "name" : "note",
+ "type" : "string",
+ "description" : "The note for this node",
+ "title" : "Note"
+ }, {
+ "name" : "parameters",
+ "type" : "object"
+ }, {
+ "name" : "uri",
+ "type" : "string",
+ "description" : "The fixed destination URI. Supports property placeholders, but not Simple expressions.",
+ "title" : "Uri",
+ "required" : true
+ }, {
+ "name" : "value",
+ "type" : "string",
+ "description" : "The case-insensitive literal value for a scalar selector.",
+ "title" : "Value",
+ "required" : true
+ } ]
+ },
+ "switch" : {
+ "title" : "Switch",
+ "description" : "Evaluates a selector once and dispatches to a fixed endpoint by literal scalar values",
+ "label" : "eip,routing",
+ "input" : true,
+ "isListItem" : true,
+ "children" : [ {
+ "name" : "id",
+ "type" : "string",
+ "description" : "The id of this node",
+ "title" : "Id",
+ "displayName" : "Id",
+ "kind" : "attribute",
+ "index" : 0,
+ "group" : "common"
+ }, {
+ "name" : "note",
+ "type" : "string",
+ "description" : "The note for this node",
+ "title" : "Note",
+ "displayName" : "Note",
+ "kind" : "attribute",
+ "index" : 1,
+ "group" : "common"
+ }, {
+ "name" : "description",
+ "type" : "string",
+ "description" : "The description for this node",
+ "title" : "Description",
+ "displayName" : "Description",
+ "kind" : "attribute",
+ "index" : 2,
+ "group" : "common"
+ }, {
+ "name" : "disabled",
+ "type" : "boolean",
+ "description" : "Whether to disable this EIP from the route during build time. Once an EIP has been disabled then it cannot be enabled later at runtime.",
+ "title" : "Disabled",
+ "default" : "false",
+ "displayName" : "Disabled",
+ "kind" : "attribute",
+ "index" : 3,
+ "group" : "advanced",
+ "label" : "advanced"
+ }, {
+ "name" : "selector",
+ "type" : "object",
+ "ref" : "expressionSubElement",
+ "description" : "Expression evaluated once per entry. Returns a scalar value to match against the literal cases.",
+ "title" : "Selector",
+ "required" : true,
+ "displayName" : "Selector",
+ "kind" : "expression",
+ "index" : 4,
+ "group" : "common"
+ }, {
+ "name" : "case",
+ "type" : "array",
+ "ref" : "switchCase",
+ "description" : "Literal cases. Duplicate values are rejected at startup, ignoring case.",
+ "title" : "Case",
+ "displayName" : "Case",
+ "kind" : "element",
+ "index" : 5,
+ "group" : "common"
+ }, {
+ "name" : "otherwise",
+ "type" : "object",
+ "ref" : "switchOtherwise",
+ "description" : "Fixed fallback URI for null or unmatched selector results. Without a fallback processing continues.",
+ "title" : "Otherwise",
+ "displayName" : "Otherwise",
+ "kind" : "element",
+ "index" : 6,
+ "group" : "common"
+ } ]
+ },
+ "switchOtherwise" : {
+ "title" : "Switch Otherwise",
+ "description" : "The fixed endpoint used when no switch case matches",
+ "label" : "configuration",
+ "children" : [ {
+ "name" : "uri",
+ "type" : "string",
+ "description" : "The fixed destination URI. Supports property placeholders, but not Simple expressions.",
+ "title" : "Uri",
+ "required" : true,
+ "displayName" : "Uri",
+ "kind" : "attribute",
+ "index" : 0,
+ "group" : "common"
+ }, {
+ "name" : "parameters",
+ "type" : "object"
+ } ]
+ },
"templatedRoute" : {
"title" : "Templated Route",
"description" : "Creates a route instance from a route template, binding specific parameter values to the template's parameters",
diff --git a/components/camel-spring-parent/camel-spring-xml/src/test/java/org/apache/camel/spring/SwitchJaxbTest.java b/components/camel-spring-parent/camel-spring-xml/src/test/java/org/apache/camel/spring/SwitchJaxbTest.java
new file mode 100644
index 0000000000000..62fd99470391b
--- /dev/null
+++ b/components/camel-spring-parent/camel-spring-xml/src/test/java/org/apache/camel/spring/SwitchJaxbTest.java
@@ -0,0 +1,82 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.spring;
+
+import java.io.ByteArrayInputStream;
+import java.nio.charset.StandardCharsets;
+import java.util.Map;
+
+import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.impl.DefaultCamelContext;
+import org.apache.camel.model.RoutesDefinition;
+import org.apache.camel.model.SwitchDefinition;
+import org.apache.camel.model.language.XPathExpression;
+import org.apache.camel.xml.jaxb.JaxbHelper;
+import org.apache.camel.xml.jaxb.JaxbModelToXMLDumper;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+class SwitchJaxbTest {
+ @Test
+ void scalarLiteralsSurviveJaxbRoundTripAndExecute() throws Exception {
+ try (var context = new DefaultCamelContext()) {
+ RoutesDefinition routes = new RoutesDefinition();
+ routes.from("direct:start").doSwitch().header("decision")
+ .doCase("billing")
+ .id("billingCase").to("mock:billing")
+ .otherwise("mock:other");
+ String xml = new JaxbModelToXMLDumper().dumpModelAsXml(context, routes);
+ try (var input = new ByteArrayInputStream(xml.getBytes(StandardCharsets.UTF_8))) {
+ RoutesDefinition restored = JaxbHelper.loadRoutesDefinition(context, input);
+ context.addRouteDefinitions(restored.getRoutes());
+ }
+ context.start();
+ context.getEndpoint("mock:billing", MockEndpoint.class).expectedBodiesReceived("matched");
+ context.getEndpoint("mock:other", MockEndpoint.class).expectedBodiesReceived("other");
+ try (var template = context.createProducerTemplate()) {
+ template.sendBodyAndHeader("direct:start", "matched", "decision",
+ "BILLING");
+ template.sendBodyAndHeader("direct:start", "other", "decision",
+ "other");
+ }
+ MockEndpoint.assertIsSatisfied(context);
+ }
+ }
+
+ @Test
+ void selectorNamespacesAndLiteralBranchesSurviveJaxbRoundTrip() throws Exception {
+ try (var context = new DefaultCamelContext()) {
+ XPathExpression selector = new XPathExpression("/t:ticket/t:department/text()");
+ selector.setNamespaces(Map.of("t", "urn:tickets"));
+ RoutesDefinition routes = new RoutesDefinition();
+ routes.from("direct:start").routeId("selector").doSwitch(selector)
+ .doCase("billing", "mock:billing").otherwise("mock:other");
+ String xml = new JaxbModelToXMLDumper().dumpModelAsXml(context, routes);
+ try (var input = new ByteArrayInputStream(xml.getBytes(StandardCharsets.UTF_8))) {
+ RoutesDefinition restored = JaxbHelper.loadRoutesDefinition(context, input);
+ SwitchDefinition choice = (SwitchDefinition) restored.getRoutes().get(0).getOutputs().get(0);
+ XPathExpression xpath = (XPathExpression) choice.getSelector().getExpressionType();
+ assertEquals("/t:ticket/t:department/text()", xpath.getExpression());
+ assertEquals("urn:tickets", xpath.getNamespaces().get("t"));
+ assertEquals("billing", choice.getCases().get(0).getValue());
+ assertEquals("mock:billing", choice.getCases().get(0).getUri());
+ assertEquals("mock:other", choice.getOtherwise().getUri());
+ }
+ }
+ }
+}
diff --git a/core/camel-core-engine/src/main/docs/modules/eips/examples/json/switch.json b/core/camel-core-engine/src/main/docs/modules/eips/examples/json/switch.json
new file mode 120000
index 0000000000000..3a45d21072f40
--- /dev/null
+++ b/core/camel-core-engine/src/main/docs/modules/eips/examples/json/switch.json
@@ -0,0 +1 @@
+../../../../../../../../camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/switch.json
\ No newline at end of file
diff --git a/core/camel-core-engine/src/main/docs/modules/eips/nav.adoc b/core/camel-core-engine/src/main/docs/modules/eips/nav.adoc
index f4817f74d9ad4..6b3248b532e5f 100644
--- a/core/camel-core-engine/src/main/docs/modules/eips/nav.adoc
+++ b/core/camel-core-engine/src/main/docs/modules/eips/nav.adoc
@@ -106,6 +106,7 @@
** xref:stop-eip.adoc[Stop]
** xref:throwException-eip.adoc[Stop]
** xref:streamConfig-eip.adoc[StreamConfig]
+** xref:switch-eip.adoc[Switch]
** xref:threads-eip.adoc[Threads]
** xref:throttle-eip.adoc[Throttle]
** xref:to-eip.adoc[To]
diff --git a/core/camel-core-engine/src/main/docs/modules/eips/pages/switch-eip.adoc b/core/camel-core-engine/src/main/docs/modules/eips/pages/switch-eip.adoc
new file mode 100644
index 0000000000000..79b1b441406f5
--- /dev/null
+++ b/core/camel-core-engine/src/main/docs/modules/eips/pages/switch-eip.adoc
@@ -0,0 +1,184 @@
+= Switch EIP
+:doctitle: Switch
+:shortname: switch
+:description: Evaluates a selector once and dispatches to a fixed endpoint by literal scalar values
+:since: 4.23
+:supportlevel: Stable
+:tabs-sync-option:
+
+*Since Camel {since}*
+
+Switch selects one destination from a table declared by the route author.
+The selector can use any Camel expression language. Its result selects a case;
+it cannot supply a new endpoint URI.
+
+Use Switch for literal value dispatch. Use xref:choice-eip.adoc[Choice] for
+predicates, ranges, overlapping conditions, or nested processing steps. A case can
+send to a `direct:` route when more processing is needed. Use xref:toD-eip.adoc[To D]
+when the endpoint URI itself must be calculated dynamically.
+
+== Options
+
+// eip options: START
+include::partial$eip-options.adoc[]
+// eip options: END
+
+== Scalar selectors
+
+The selector is evaluated once on each entry. Scalar results are converted to strings
+and matched case-insensitively using the English locale. An empty string is a valid
+literal. An asterisk is literal, not a wildcard. Duplicate normalized values are
+rejected at startup.
+
+Map, collection and array results are rejected with an `IllegalArgumentException`.
+They follow normal Camel error handling and do not select `otherwise`.
+
+=== Route from a header
+
+This route reads the `department` header. The body is passed unchanged to the
+selected destination. The examples on this page are independent; load one at a
+time and connect the `direct:` destinations to your application's handling routes.
+
+[tabs]
+====
+Java::
++
+[source,java]
+----
+from("direct:tickets")
+ .doSwitch(header("department"))
+ .doCase("billing", "direct:billing")
+ .doCase("technical", "direct:technical")
+ .otherwise("direct:review")
+ .end();
+----
+XML::
++
+[source,xml]
+----
+
+
+
+
+
+
+
+
+
+----
+YAML::
++
+[source,yaml]
+----
+- route:
+ from:
+ uri: direct:tickets
+ steps:
+ - switch:
+ selector:
+ header:
+ expression: department
+ case:
+ - value: billing
+ uri: direct:billing
+ - value: technical
+ uri: direct:technical
+ otherwise:
+ uri: direct:review
+----
+====
+
+Send a message to any of these equivalent routes with a `ProducerTemplate`:
+
+[source,java]
+----
+template.sendBodyAndHeader("direct:tickets", "Please check this invoice",
+ "department", "BILLING");
+----
+
+[cols="1,2",options="header"]
+|===
+|Header value |Destination
+|`billing` or `BILLING` |`direct:billing`
+|`technical` |`direct:technical`
+|`sales` or an absent header |`direct:review`
+|===
+
+A null or unmatched result uses `otherwise`. Without `otherwise`, the exchange
+continues after Switch. Selector failures follow normal Camel error handling and
+never select the fallback. Streams are reset after selector evaluation when stream
+caching is enabled. Loops and retries that enter Switch again evaluate the selector
+again; results are not cached across entries.
+
+=== Connect the example destinations
+
+For a local demonstration, the destination routes can simply log the message.
+Load these routes alongside one of the examples above; replace the logging steps
+with the application's processing when integrating the example.
+
+[tabs]
+====
+Java::
++
+[source,java]
+----
+from("direct:billing").log("Billing: ${body}");
+from("direct:technical").log("Technical: ${body}");
+from("direct:review").log("Review: ${body}");
+----
+XML::
++
+[source,xml]
+----
+
+
+
+
+
+----
+YAML::
++
+[source,yaml]
+----
+- route:
+ from:
+ uri: direct:billing
+ steps:
+ - log: "Billing: ${body}"
+- route:
+ from:
+ uri: direct:technical
+ steps:
+ - log: "Technical: ${body}"
+- route:
+ from:
+ uri: direct:review
+ steps:
+ - log: "Review: ${body}"
+----
+====
+
+== Destinations and management
+
+Case and fallback URIs support property placeholders resolved at startup. Simple
+expressions in URIs are rejected. In YAML, both cases and `otherwise` accept `uri`
+plus `parameters`:
+
+[source,yaml]
+----
+case:
+ - value: orders
+ uri: kafka
+ parameters:
+ topic: orders
+otherwise:
+ uri: direct
+ parameters:
+ name: review
+----
+
+Each case has an identity for tracing, debugging and management. The Switch MBean's
+`extendedInformation` table reports case IDs, literal values, destination URIs and
+selection counts. URIs are masked when management masking is enabled (the default).
+These counts indicate case selection, not successful delivery.
+`UnmatchedCount` also records unmatched results when no fallback is configured.
diff --git a/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/a2aSubTask.json b/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/a2aSubTask.json
index 4e3ac7673b7be..ebf2a61f68a74 100644
--- a/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/a2aSubTask.json
+++ b/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/a2aSubTask.json
@@ -21,6 +21,6 @@
"emitAfter": { "index": 5, "kind": "attribute", "displayName": "Emit After", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Simple expression template to emit after the nested steps complete successfully" },
"emitOnError": { "index": 6, "kind": "attribute", "displayName": "Emit On Error", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Simple expression template to emit when the nested steps fail" },
"failIfNoTaskContext": { "index": 7, "kind": "attribute", "displayName": "Fail If No Task Context", "group": "common", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether to fail if the current Exchange does not have an active A2A task context" },
- "outputs": { "index": 8, "kind": "element", "displayName": "Outputs", "group": "common", "required": true, "type": "array", "javaType": "java.util.List", "oneOf": [ "a2aSubTask", "aggregate", "bean", "cache", "choice", "circuitBreaker", "claimCheck", "convertBodyTo", "convertHeaderTo", "convertVariableTo", "delay", "doCatch", "doFinally", "doTry", "dynamicRouter", "enrich", "filter", "idempotentConsumer", "intercept", "interceptFrom", "interceptSendToEndpoint", "kamelet", "loadBalance", "log", "loop", "marshal", "multicast", "onCompletion", "onException", "pausable", "pipeline", "policy", "poll", "pollEnrich", "process", "recipientList", "removeHeader", "removeHeaders", "removeProperties", "removeProperty", "removeVariable", "resequence", "resumable", "rollback", "routingSlip", "saga", "sample", "script", "setBody", "setExchangePattern", "setHeader", "setHeaders", "setProperty", "setVariable", "setVariables", "sort", "split", "step", "stop", "threads", "throttle", "throwException", "to", "toD", "tokenizer", "transacted", "transform", "transformDataType", "unmarshal", "validate", "wireTap" ], "deprecated": false, "autowired": false, "secret": false }
+ "outputs": { "index": 8, "kind": "element", "displayName": "Outputs", "group": "common", "required": true, "type": "array", "javaType": "java.util.List", "oneOf": [ "a2aSubTask", "aggregate", "bean", "cache", "choice", "circuitBreaker", "claimCheck", "convertBodyTo", "convertHeaderTo", "convertVariableTo", "delay", "doCatch", "doFinally", "doTry", "dynamicRouter", "enrich", "filter", "idempotentConsumer", "intercept", "interceptFrom", "interceptSendToEndpoint", "kamelet", "loadBalance", "log", "loop", "marshal", "multicast", "onCompletion", "onException", "pausable", "pipeline", "policy", "poll", "pollEnrich", "process", "recipientList", "removeHeader", "removeHeaders", "removeProperties", "removeProperty", "removeVariable", "resequence", "resumable", "rollback", "routingSlip", "saga", "sample", "script", "setBody", "setExchangePattern", "setHeader", "setHeaders", "setProperty", "setVariable", "setVariables", "sort", "split", "step", "stop", "switch", "threads", "throttle", "throwException", "to", "toD", "tokenizer", "transacted", "transform", "transformDataType", "unmarshal", "validate", "wireTap" ], "deprecated": false, "autowired": false, "secret": false }
}
}
diff --git a/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/aggregate.json b/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/aggregate.json
index 0fb9ff69a07f9..b44e99f13f841 100644
--- a/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/aggregate.json
+++ b/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/aggregate.json
@@ -45,7 +45,7 @@
"discardOnAggregationFailure": { "index": 29, "kind": "attribute", "displayName": "Discard On Aggregation Failure", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "If enabled then the partly aggregated message is discarded when aggregation failed (an exception was thrown from AggregationStrategy). Cannot be used together with completionFromBatchConsumer." },
"forceCompletionOnStop": { "index": 30, "kind": "attribute", "displayName": "Force Completion On Stop", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "If enabled then all current aggregated exchanges are completed when the context is stopped." },
"completeAllOnStop": { "index": 31, "kind": "attribute", "displayName": "Complete All On Stop", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "If enabled then waits to complete all current and partial (pending) aggregated exchanges when the context is stopped, ensuring the aggregation repository is empty before shutdown." },
- "outputs": { "index": 32, "kind": "element", "displayName": "Outputs", "group": "common", "required": true, "type": "array", "javaType": "java.util.List", "oneOf": [ "a2aSubTask", "aggregate", "bean", "cache", "choice", "circuitBreaker", "claimCheck", "convertBodyTo", "convertHeaderTo", "convertVariableTo", "delay", "doCatch", "doFinally", "doTry", "dynamicRouter", "enrich", "filter", "idempotentConsumer", "intercept", "interceptFrom", "interceptSendToEndpoint", "kamelet", "loadBalance", "log", "loop", "marshal", "multicast", "onCompletion", "onException", "pausable", "pipeline", "policy", "poll", "pollEnrich", "process", "recipientList", "removeHeader", "removeHeaders", "removeProperties", "removeProperty", "removeVariable", "resequence", "resumable", "rollback", "routingSlip", "saga", "sample", "script", "setBody", "setExchangePattern", "setHeader", "setHeaders", "setProperty", "setVariable", "setVariables", "sort", "split", "step", "stop", "threads", "throttle", "throwException", "to", "toD", "tokenizer", "transacted", "transform", "transformDataType", "unmarshal", "validate", "wireTap" ], "deprecated": false, "autowired": false, "secret": false }
+ "outputs": { "index": 32, "kind": "element", "displayName": "Outputs", "group": "common", "required": true, "type": "array", "javaType": "java.util.List", "oneOf": [ "a2aSubTask", "aggregate", "bean", "cache", "choice", "circuitBreaker", "claimCheck", "convertBodyTo", "convertHeaderTo", "convertVariableTo", "delay", "doCatch", "doFinally", "doTry", "dynamicRouter", "enrich", "filter", "idempotentConsumer", "intercept", "interceptFrom", "interceptSendToEndpoint", "kamelet", "loadBalance", "log", "loop", "marshal", "multicast", "onCompletion", "onException", "pausable", "pipeline", "policy", "poll", "pollEnrich", "process", "recipientList", "removeHeader", "removeHeaders", "removeProperties", "removeProperty", "removeVariable", "resequence", "resumable", "rollback", "routingSlip", "saga", "sample", "script", "setBody", "setExchangePattern", "setHeader", "setHeaders", "setProperty", "setVariable", "setVariables", "sort", "split", "step", "stop", "switch", "threads", "throttle", "throwException", "to", "toD", "tokenizer", "transacted", "transform", "transformDataType", "unmarshal", "validate", "wireTap" ], "deprecated": false, "autowired": false, "secret": false }
},
"exchangeProperties": {
"CamelAggregatedSize": { "index": 0, "kind": "exchangeProperty", "displayName": "Aggregated Size", "label": "producer", "required": false, "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "important": true, "description": "Number of exchanges that was grouped together." },
diff --git a/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/cache.json b/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/cache.json
index 459a15180559f..08f5ce5c924b6 100644
--- a/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/cache.json
+++ b/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/cache.json
@@ -21,6 +21,6 @@
"keyValueRepository": { "index": 5, "kind": "attribute", "displayName": "Key Value Repository", "group": "common", "required": false, "type": "object", "javaType": "org.apache.camel.spi.KeyValueRepository", "deprecated": false, "autowired": false, "secret": false, "description": "Sets the reference name of the KeyValueRepository to use as the cache backing store. If not set, a MemoryKeyValueRepository is auto-created." },
"ttl": { "index": 6, "kind": "attribute", "displayName": "Ttl", "group": "common", "required": false, "type": "duration", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "-1", "description": "Sets the time-to-live for cached entries. Supports duration syntax (e.g. 10m, 1h) or milliseconds. Default: -1 (no expiration)." },
"cacheNull": { "index": 7, "kind": "attribute", "displayName": "Cache Null", "group": "common", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether to cache null results. By default, null message bodies are not cached." },
- "outputs": { "index": 8, "kind": "element", "displayName": "Outputs", "group": "common", "required": true, "type": "array", "javaType": "java.util.List>", "oneOf": [ "a2aSubTask", "aggregate", "bean", "cache", "choice", "circuitBreaker", "claimCheck", "convertBodyTo", "convertHeaderTo", "convertVariableTo", "delay", "doCatch", "doFinally", "doTry", "dynamicRouter", "enrich", "filter", "idempotentConsumer", "intercept", "interceptFrom", "interceptSendToEndpoint", "kamelet", "loadBalance", "log", "loop", "marshal", "multicast", "onCompletion", "onException", "pausable", "pipeline", "policy", "poll", "pollEnrich", "process", "recipientList", "removeHeader", "removeHeaders", "removeProperties", "removeProperty", "removeVariable", "resequence", "resumable", "rollback", "routingSlip", "saga", "sample", "script", "setBody", "setExchangePattern", "setHeader", "setHeaders", "setProperty", "setVariable", "setVariables", "sort", "split", "step", "stop", "threads", "throttle", "throwException", "to", "toD", "tokenizer", "transacted", "transform", "transformDataType", "unmarshal", "validate", "wireTap" ], "deprecated": false, "autowired": false, "secret": false }
+ "outputs": { "index": 8, "kind": "element", "displayName": "Outputs", "group": "common", "required": true, "type": "array", "javaType": "java.util.List>", "oneOf": [ "a2aSubTask", "aggregate", "bean", "cache", "choice", "circuitBreaker", "claimCheck", "convertBodyTo", "convertHeaderTo", "convertVariableTo", "delay", "doCatch", "doFinally", "doTry", "dynamicRouter", "enrich", "filter", "idempotentConsumer", "intercept", "interceptFrom", "interceptSendToEndpoint", "kamelet", "loadBalance", "log", "loop", "marshal", "multicast", "onCompletion", "onException", "pausable", "pipeline", "policy", "poll", "pollEnrich", "process", "recipientList", "removeHeader", "removeHeaders", "removeProperties", "removeProperty", "removeVariable", "resequence", "resumable", "rollback", "routingSlip", "saga", "sample", "script", "setBody", "setExchangePattern", "setHeader", "setHeaders", "setProperty", "setVariable", "setVariables", "sort", "split", "step", "stop", "switch", "threads", "throttle", "throwException", "to", "toD", "tokenizer", "transacted", "transform", "transformDataType", "unmarshal", "validate", "wireTap" ], "deprecated": false, "autowired": false, "secret": false }
}
}
diff --git a/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/case.json b/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/case.json
new file mode 100644
index 0000000000000..39ad4ab00f2c9
--- /dev/null
+++ b/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/case.json
@@ -0,0 +1,21 @@
+{
+ "model": {
+ "kind": "model",
+ "name": "case",
+ "title": "Case",
+ "description": "A literal switch case with one fixed endpoint destination",
+ "deprecated": false,
+ "label": "configuration",
+ "javaType": "org.apache.camel.model.SwitchCaseDefinition",
+ "abstract": false,
+ "input": false,
+ "output": false
+ },
+ "properties": {
+ "id": { "index": 0, "kind": "attribute", "displayName": "Id", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The id of this node" },
+ "note": { "index": 1, "kind": "attribute", "displayName": "Note", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The note for this node" },
+ "description": { "index": 2, "kind": "attribute", "displayName": "Description", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The description for this node" },
+ "value": { "index": 3, "kind": "attribute", "displayName": "Value", "group": "common", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The case-insensitive literal value for a scalar selector." },
+ "uri": { "index": 4, "kind": "attribute", "displayName": "Uri", "group": "common", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The fixed destination URI. Supports property placeholders, but not Simple expressions." }
+ }
+}
diff --git a/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/circuitBreaker.json b/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/circuitBreaker.json
index 5880e386c3423..e9b6c76a5f46e 100644
--- a/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/circuitBreaker.json
+++ b/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/circuitBreaker.json
@@ -22,7 +22,7 @@
"resilience4jConfiguration": { "index": 6, "kind": "element", "displayName": "Resilience4j Configuration", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.model.Resilience4jConfigurationDefinition", "deprecated": false, "autowired": false, "secret": false, "description": "Configures the circuit breaker to use Resilience4j with the given configuration." },
"faultToleranceConfiguration": { "index": 7, "kind": "element", "displayName": "Fault Tolerance Configuration", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.model.FaultToleranceConfigurationDefinition", "deprecated": false, "autowired": false, "secret": false, "description": "Configures the circuit breaker to use MicroProfile Fault Tolerance with the given configuration." },
"onFallback": { "index": 8, "kind": "element", "displayName": "On Fallback", "group": "common", "required": false, "type": "object", "javaType": "org.apache.camel.model.OnFallbackDefinition", "deprecated": false, "autowired": false, "secret": false, "description": "The fallback route path to execute when the circuit breaker triggers." },
- "outputs": { "index": 9, "kind": "element", "displayName": "Outputs", "group": "common", "required": true, "type": "array", "javaType": "java.util.List", "oneOf": [ "a2aSubTask", "aggregate", "bean", "cache", "choice", "circuitBreaker", "claimCheck", "convertBodyTo", "convertHeaderTo", "convertVariableTo", "delay", "doCatch", "doFinally", "doTry", "dynamicRouter", "enrich", "filter", "idempotentConsumer", "intercept", "interceptFrom", "interceptSendToEndpoint", "kamelet", "loadBalance", "log", "loop", "marshal", "multicast", "onCompletion", "onException", "pausable", "pipeline", "policy", "poll", "pollEnrich", "process", "recipientList", "removeHeader", "removeHeaders", "removeProperties", "removeProperty", "removeVariable", "resequence", "resumable", "rollback", "routingSlip", "saga", "sample", "script", "setBody", "setExchangePattern", "setHeader", "setHeaders", "setProperty", "setVariable", "setVariables", "sort", "split", "step", "stop", "threads", "throttle", "throwException", "to", "toD", "tokenizer", "transacted", "transform", "transformDataType", "unmarshal", "validate", "wireTap" ], "deprecated": false, "autowired": false, "secret": false }
+ "outputs": { "index": 9, "kind": "element", "displayName": "Outputs", "group": "common", "required": true, "type": "array", "javaType": "java.util.List", "oneOf": [ "a2aSubTask", "aggregate", "bean", "cache", "choice", "circuitBreaker", "claimCheck", "convertBodyTo", "convertHeaderTo", "convertVariableTo", "delay", "doCatch", "doFinally", "doTry", "dynamicRouter", "enrich", "filter", "idempotentConsumer", "intercept", "interceptFrom", "interceptSendToEndpoint", "kamelet", "loadBalance", "log", "loop", "marshal", "multicast", "onCompletion", "onException", "pausable", "pipeline", "policy", "poll", "pollEnrich", "process", "recipientList", "removeHeader", "removeHeaders", "removeProperties", "removeProperty", "removeVariable", "resequence", "resumable", "rollback", "routingSlip", "saga", "sample", "script", "setBody", "setExchangePattern", "setHeader", "setHeaders", "setProperty", "setVariable", "setVariables", "sort", "split", "step", "stop", "switch", "threads", "throttle", "throwException", "to", "toD", "tokenizer", "transacted", "transform", "transformDataType", "unmarshal", "validate", "wireTap" ], "deprecated": false, "autowired": false, "secret": false }
},
"exchangeProperties": {
"CamelResponseSuccessfulExecution": { "index": 0, "kind": "exchangeProperty", "displayName": "Response Successful Execution", "label": "producer", "required": false, "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "description": "Whether the exchange was processed successfully by the circuit breaker" },
diff --git a/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/doCatch.json b/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/doCatch.json
index 2ce320d08830f..f71c063b00bde 100644
--- a/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/doCatch.json
+++ b/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/doCatch.json
@@ -18,7 +18,7 @@
"disabled": { "index": 3, "kind": "attribute", "displayName": "Disabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether to disable this EIP from the route during build time. Once an EIP has been disabled then it cannot be enabled later at runtime." },
"exception": { "index": 4, "kind": "element", "displayName": "Exception", "group": "common", "required": false, "type": "array", "javaType": "java.util.List", "deprecated": false, "autowired": false, "secret": false, "description": "The exception class names (fully qualified) to catch." },
"onWhen": { "index": 5, "kind": "element", "displayName": "On When", "group": "common", "required": false, "type": "object", "javaType": "org.apache.camel.model.OnWhenDefinition", "deprecated": false, "autowired": false, "secret": false, "asPredicate": true, "description": "An additional predicate that must evaluate to true for this doCatch to trigger. Allows fine-grained control over which exceptions are caught based on the exchange state." },
- "outputs": { "index": 6, "kind": "element", "displayName": "Outputs", "group": "common", "required": true, "type": "array", "javaType": "java.util.List", "oneOf": [ "a2aSubTask", "aggregate", "bean", "cache", "choice", "circuitBreaker", "claimCheck", "convertBodyTo", "convertHeaderTo", "convertVariableTo", "delay", "doCatch", "doFinally", "doTry", "dynamicRouter", "enrich", "filter", "idempotentConsumer", "intercept", "interceptFrom", "interceptSendToEndpoint", "kamelet", "loadBalance", "log", "loop", "marshal", "multicast", "onCompletion", "onException", "pausable", "pipeline", "policy", "poll", "pollEnrich", "process", "recipientList", "removeHeader", "removeHeaders", "removeProperties", "removeProperty", "removeVariable", "resequence", "resumable", "rollback", "routingSlip", "saga", "sample", "script", "setBody", "setExchangePattern", "setHeader", "setHeaders", "setProperty", "setVariable", "setVariables", "sort", "split", "step", "stop", "threads", "throttle", "throwException", "to", "toD", "tokenizer", "transacted", "transform", "transformDataType", "unmarshal", "validate", "wireTap" ], "deprecated": false, "autowired": false, "secret": false }
+ "outputs": { "index": 6, "kind": "element", "displayName": "Outputs", "group": "common", "required": true, "type": "array", "javaType": "java.util.List", "oneOf": [ "a2aSubTask", "aggregate", "bean", "cache", "choice", "circuitBreaker", "claimCheck", "convertBodyTo", "convertHeaderTo", "convertVariableTo", "delay", "doCatch", "doFinally", "doTry", "dynamicRouter", "enrich", "filter", "idempotentConsumer", "intercept", "interceptFrom", "interceptSendToEndpoint", "kamelet", "loadBalance", "log", "loop", "marshal", "multicast", "onCompletion", "onException", "pausable", "pipeline", "policy", "poll", "pollEnrich", "process", "recipientList", "removeHeader", "removeHeaders", "removeProperties", "removeProperty", "removeVariable", "resequence", "resumable", "rollback", "routingSlip", "saga", "sample", "script", "setBody", "setExchangePattern", "setHeader", "setHeaders", "setProperty", "setVariable", "setVariables", "sort", "split", "step", "stop", "switch", "threads", "throttle", "throwException", "to", "toD", "tokenizer", "transacted", "transform", "transformDataType", "unmarshal", "validate", "wireTap" ], "deprecated": false, "autowired": false, "secret": false }
},
"exchangeProperties": {
"CamelExceptionCaught": { "index": 0, "kind": "exchangeProperty", "displayName": "Exception Caught", "label": "producer", "required": false, "javaType": "java.lang.Exception", "deprecated": false, "autowired": false, "secret": false, "description": "Stores the caught exception due to a processing error of the current Exchange" },
diff --git a/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/doFinally.json b/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/doFinally.json
index 431f292b84515..015e9389917fb 100644
--- a/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/doFinally.json
+++ b/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/doFinally.json
@@ -16,7 +16,7 @@
"note": { "index": 1, "kind": "attribute", "displayName": "Note", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The note for this node" },
"description": { "index": 2, "kind": "attribute", "displayName": "Description", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The description for this node" },
"disabled": { "index": 3, "kind": "attribute", "displayName": "Disabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether to disable this EIP from the route during build time. Once an EIP has been disabled then it cannot be enabled later at runtime." },
- "outputs": { "index": 4, "kind": "element", "displayName": "Outputs", "group": "common", "required": true, "type": "array", "javaType": "java.util.List", "oneOf": [ "a2aSubTask", "aggregate", "bean", "cache", "choice", "circuitBreaker", "claimCheck", "convertBodyTo", "convertHeaderTo", "convertVariableTo", "delay", "doCatch", "doFinally", "doTry", "dynamicRouter", "enrich", "filter", "idempotentConsumer", "intercept", "interceptFrom", "interceptSendToEndpoint", "kamelet", "loadBalance", "log", "loop", "marshal", "multicast", "onCompletion", "onException", "pausable", "pipeline", "policy", "poll", "pollEnrich", "process", "recipientList", "removeHeader", "removeHeaders", "removeProperties", "removeProperty", "removeVariable", "resequence", "resumable", "rollback", "routingSlip", "saga", "sample", "script", "setBody", "setExchangePattern", "setHeader", "setHeaders", "setProperty", "setVariable", "setVariables", "sort", "split", "step", "stop", "threads", "throttle", "throwException", "to", "toD", "tokenizer", "transacted", "transform", "transformDataType", "unmarshal", "validate", "wireTap" ], "deprecated": false, "autowired": false, "secret": false }
+ "outputs": { "index": 4, "kind": "element", "displayName": "Outputs", "group": "common", "required": true, "type": "array", "javaType": "java.util.List", "oneOf": [ "a2aSubTask", "aggregate", "bean", "cache", "choice", "circuitBreaker", "claimCheck", "convertBodyTo", "convertHeaderTo", "convertVariableTo", "delay", "doCatch", "doFinally", "doTry", "dynamicRouter", "enrich", "filter", "idempotentConsumer", "intercept", "interceptFrom", "interceptSendToEndpoint", "kamelet", "loadBalance", "log", "loop", "marshal", "multicast", "onCompletion", "onException", "pausable", "pipeline", "policy", "poll", "pollEnrich", "process", "recipientList", "removeHeader", "removeHeaders", "removeProperties", "removeProperty", "removeVariable", "resequence", "resumable", "rollback", "routingSlip", "saga", "sample", "script", "setBody", "setExchangePattern", "setHeader", "setHeaders", "setProperty", "setVariable", "setVariables", "sort", "split", "step", "stop", "switch", "threads", "throttle", "throwException", "to", "toD", "tokenizer", "transacted", "transform", "transformDataType", "unmarshal", "validate", "wireTap" ], "deprecated": false, "autowired": false, "secret": false }
},
"exchangeProperties": {
"CamelExceptionCaught": { "index": 0, "kind": "exchangeProperty", "displayName": "Exception Caught", "label": "producer", "required": false, "javaType": "java.lang.Exception", "deprecated": false, "autowired": false, "secret": false, "description": "Stores the caught exception due to a processing error of the current Exchange" },
diff --git a/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/doTry.json b/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/doTry.json
index 28998908d77aa..1ab592d6688da 100644
--- a/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/doTry.json
+++ b/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/doTry.json
@@ -16,7 +16,7 @@
"note": { "index": 1, "kind": "attribute", "displayName": "Note", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The note for this node" },
"description": { "index": 2, "kind": "attribute", "displayName": "Description", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The description for this node" },
"disabled": { "index": 3, "kind": "attribute", "displayName": "Disabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether to disable this EIP from the route during build time. Once an EIP has been disabled then it cannot be enabled later at runtime." },
- "outputs": { "index": 4, "kind": "element", "displayName": "Outputs", "group": "common", "required": true, "type": "array", "javaType": "java.util.List", "oneOf": [ "a2aSubTask", "aggregate", "bean", "cache", "choice", "circuitBreaker", "claimCheck", "convertBodyTo", "convertHeaderTo", "convertVariableTo", "delay", "doCatch", "doFinally", "doTry", "dynamicRouter", "enrich", "filter", "idempotentConsumer", "intercept", "interceptFrom", "interceptSendToEndpoint", "kamelet", "loadBalance", "log", "loop", "marshal", "multicast", "onCompletion", "onException", "pausable", "pipeline", "policy", "poll", "pollEnrich", "process", "recipientList", "removeHeader", "removeHeaders", "removeProperties", "removeProperty", "removeVariable", "resequence", "resumable", "rollback", "routingSlip", "saga", "sample", "script", "setBody", "setExchangePattern", "setHeader", "setHeaders", "setProperty", "setVariable", "setVariables", "sort", "split", "step", "stop", "threads", "throttle", "throwException", "to", "toD", "tokenizer", "transacted", "transform", "transformDataType", "unmarshal", "validate", "wireTap" ], "deprecated": false, "autowired": false, "secret": false },
+ "outputs": { "index": 4, "kind": "element", "displayName": "Outputs", "group": "common", "required": true, "type": "array", "javaType": "java.util.List", "oneOf": [ "a2aSubTask", "aggregate", "bean", "cache", "choice", "circuitBreaker", "claimCheck", "convertBodyTo", "convertHeaderTo", "convertVariableTo", "delay", "doCatch", "doFinally", "doTry", "dynamicRouter", "enrich", "filter", "idempotentConsumer", "intercept", "interceptFrom", "interceptSendToEndpoint", "kamelet", "loadBalance", "log", "loop", "marshal", "multicast", "onCompletion", "onException", "pausable", "pipeline", "policy", "poll", "pollEnrich", "process", "recipientList", "removeHeader", "removeHeaders", "removeProperties", "removeProperty", "removeVariable", "resequence", "resumable", "rollback", "routingSlip", "saga", "sample", "script", "setBody", "setExchangePattern", "setHeader", "setHeaders", "setProperty", "setVariable", "setVariables", "sort", "split", "step", "stop", "switch", "threads", "throttle", "throwException", "to", "toD", "tokenizer", "transacted", "transform", "transformDataType", "unmarshal", "validate", "wireTap" ], "deprecated": false, "autowired": false, "secret": false },
"doCatch": { "index": 5, "kind": "element", "displayName": "Do Catch", "group": "common", "required": false, "type": "array", "javaType": "java.util.List", "oneOf": [ "doCatch" ], "deprecated": false, "autowired": false, "secret": false, "description": "Catches exceptions as part of a try, catch, finally block" },
"doFinally": { "index": 6, "kind": "element", "displayName": "Do Finally", "group": "common", "required": false, "type": "object", "javaType": "org.apache.camel.model.FinallyDefinition", "deprecated": false, "autowired": false, "secret": false, "description": "Path traversed when a try, catch, finally block exits" }
}
diff --git a/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/filter.json b/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/filter.json
index c1300ea647c1c..14e7752a5be72 100644
--- a/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/filter.json
+++ b/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/filter.json
@@ -19,6 +19,6 @@
"disabled": { "index": 3, "kind": "attribute", "displayName": "Disabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether to disable this EIP from the route during build time. Once an EIP has been disabled then it cannot be enabled later at runtime." },
"expression": { "index": 4, "kind": "expression", "displayName": "Expression", "group": "common", "required": true, "type": "object", "javaType": "org.apache.camel.model.language.ExpressionDefinition", "oneOf": [ "constant", "datasonnet", "exchangeProperty", "groovy", "header", "hl7terser", "jactl", "java", "jq", "js", "jsonpath", "language", "method", "mvel", "ognl", "python", "python3", "quickjs", "ref", "simple", "spel", "tokenize", "variable", "wasm", "xpath", "xquery", "xtokenize" ], "deprecated": false, "autowired": false, "secret": false, "asPredicate": true, "description": "The predicate expression to evaluate. Messages where the predicate returns false are filtered out and not routed further." },
"statusPropertyName": { "index": 5, "kind": "attribute", "displayName": "Status Property Name", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Name of an exchange property to store whether the filter predicate matched or not. The value is stored as a boolean." },
- "outputs": { "index": 6, "kind": "element", "displayName": "Outputs", "group": "common", "required": true, "type": "array", "javaType": "java.util.List>", "oneOf": [ "a2aSubTask", "aggregate", "bean", "cache", "choice", "circuitBreaker", "claimCheck", "convertBodyTo", "convertHeaderTo", "convertVariableTo", "delay", "doCatch", "doFinally", "doTry", "dynamicRouter", "enrich", "filter", "idempotentConsumer", "intercept", "interceptFrom", "interceptSendToEndpoint", "kamelet", "loadBalance", "log", "loop", "marshal", "multicast", "onCompletion", "onException", "pausable", "pipeline", "policy", "poll", "pollEnrich", "process", "recipientList", "removeHeader", "removeHeaders", "removeProperties", "removeProperty", "removeVariable", "resequence", "resumable", "rollback", "routingSlip", "saga", "sample", "script", "setBody", "setExchangePattern", "setHeader", "setHeaders", "setProperty", "setVariable", "setVariables", "sort", "split", "step", "stop", "threads", "throttle", "throwException", "to", "toD", "tokenizer", "transacted", "transform", "transformDataType", "unmarshal", "validate", "wireTap" ], "deprecated": false, "autowired": false, "secret": false }
+ "outputs": { "index": 6, "kind": "element", "displayName": "Outputs", "group": "common", "required": true, "type": "array", "javaType": "java.util.List>", "oneOf": [ "a2aSubTask", "aggregate", "bean", "cache", "choice", "circuitBreaker", "claimCheck", "convertBodyTo", "convertHeaderTo", "convertVariableTo", "delay", "doCatch", "doFinally", "doTry", "dynamicRouter", "enrich", "filter", "idempotentConsumer", "intercept", "interceptFrom", "interceptSendToEndpoint", "kamelet", "loadBalance", "log", "loop", "marshal", "multicast", "onCompletion", "onException", "pausable", "pipeline", "policy", "poll", "pollEnrich", "process", "recipientList", "removeHeader", "removeHeaders", "removeProperties", "removeProperty", "removeVariable", "resequence", "resumable", "rollback", "routingSlip", "saga", "sample", "script", "setBody", "setExchangePattern", "setHeader", "setHeaders", "setProperty", "setVariable", "setVariables", "sort", "split", "step", "stop", "switch", "threads", "throttle", "throwException", "to", "toD", "tokenizer", "transacted", "transform", "transformDataType", "unmarshal", "validate", "wireTap" ], "deprecated": false, "autowired": false, "secret": false }
}
}
diff --git a/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/idempotentConsumer.json b/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/idempotentConsumer.json
index ac640cd7983f7..f027166a0bfc3 100644
--- a/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/idempotentConsumer.json
+++ b/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/idempotentConsumer.json
@@ -23,7 +23,7 @@
"completionEager": { "index": 7, "kind": "attribute", "displayName": "Completion Eager", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Sets whether to complete the idempotent consumer eager or when the exchange is done." },
"skipDuplicate": { "index": 8, "kind": "attribute", "displayName": "Skip Duplicate", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Sets whether to skip duplicates or not. The default behavior is to skip duplicates." },
"removeOnFailure": { "index": 9, "kind": "attribute", "displayName": "Remove On Failure", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Sets whether to remove or keep the key on failure. The default behavior is to remove the key on failure." },
- "outputs": { "index": 10, "kind": "element", "displayName": "Outputs", "group": "common", "required": true, "type": "array", "javaType": "java.util.List>", "oneOf": [ "a2aSubTask", "aggregate", "bean", "cache", "choice", "circuitBreaker", "claimCheck", "convertBodyTo", "convertHeaderTo", "convertVariableTo", "delay", "doCatch", "doFinally", "doTry", "dynamicRouter", "enrich", "filter", "idempotentConsumer", "intercept", "interceptFrom", "interceptSendToEndpoint", "kamelet", "loadBalance", "log", "loop", "marshal", "multicast", "onCompletion", "onException", "pausable", "pipeline", "policy", "poll", "pollEnrich", "process", "recipientList", "removeHeader", "removeHeaders", "removeProperties", "removeProperty", "removeVariable", "resequence", "resumable", "rollback", "routingSlip", "saga", "sample", "script", "setBody", "setExchangePattern", "setHeader", "setHeaders", "setProperty", "setVariable", "setVariables", "sort", "split", "step", "stop", "threads", "throttle", "throwException", "to", "toD", "tokenizer", "transacted", "transform", "transformDataType", "unmarshal", "validate", "wireTap" ], "deprecated": false, "autowired": false, "secret": false }
+ "outputs": { "index": 10, "kind": "element", "displayName": "Outputs", "group": "common", "required": true, "type": "array", "javaType": "java.util.List>", "oneOf": [ "a2aSubTask", "aggregate", "bean", "cache", "choice", "circuitBreaker", "claimCheck", "convertBodyTo", "convertHeaderTo", "convertVariableTo", "delay", "doCatch", "doFinally", "doTry", "dynamicRouter", "enrich", "filter", "idempotentConsumer", "intercept", "interceptFrom", "interceptSendToEndpoint", "kamelet", "loadBalance", "log", "loop", "marshal", "multicast", "onCompletion", "onException", "pausable", "pipeline", "policy", "poll", "pollEnrich", "process", "recipientList", "removeHeader", "removeHeaders", "removeProperties", "removeProperty", "removeVariable", "resequence", "resumable", "rollback", "routingSlip", "saga", "sample", "script", "setBody", "setExchangePattern", "setHeader", "setHeaders", "setProperty", "setVariable", "setVariables", "sort", "split", "step", "stop", "switch", "threads", "throttle", "throwException", "to", "toD", "tokenizer", "transacted", "transform", "transformDataType", "unmarshal", "validate", "wireTap" ], "deprecated": false, "autowired": false, "secret": false }
},
"exchangeProperties": {
"CamelDuplicateMessage": { "index": 0, "kind": "exchangeProperty", "displayName": "Duplicate Message", "label": "producer", "required": false, "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "description": "Whether this exchange is a duplicate detected by the Idempotent Consumer EIP" }
diff --git a/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/intercept.json b/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/intercept.json
index d630b9c923a84..a828928287df4 100644
--- a/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/intercept.json
+++ b/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/intercept.json
@@ -17,7 +17,7 @@
"description": { "index": 2, "kind": "attribute", "displayName": "Description", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The description for this node" },
"disabled": { "index": 3, "kind": "attribute", "displayName": "Disabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether to disable this EIP from the route during build time. Once an EIP has been disabled then it cannot be enabled later at runtime." },
"onWhen": { "index": 4, "kind": "element", "displayName": "On When", "group": "common", "required": false, "type": "object", "javaType": "org.apache.camel.model.OnWhenDefinition", "deprecated": false, "autowired": false, "secret": false, "asPredicate": true, "description": "To use an expression to only trigger intercepting in specific situations" },
- "outputs": { "index": 5, "kind": "element", "displayName": "Outputs", "group": "common", "required": true, "type": "array", "javaType": "java.util.List", "oneOf": [ "a2aSubTask", "aggregate", "bean", "cache", "choice", "circuitBreaker", "claimCheck", "convertBodyTo", "convertHeaderTo", "convertVariableTo", "delay", "doCatch", "doFinally", "doTry", "dynamicRouter", "enrich", "filter", "idempotentConsumer", "intercept", "interceptFrom", "interceptSendToEndpoint", "kamelet", "loadBalance", "log", "loop", "marshal", "multicast", "onCompletion", "onException", "pausable", "pipeline", "policy", "poll", "pollEnrich", "process", "recipientList", "removeHeader", "removeHeaders", "removeProperties", "removeProperty", "removeVariable", "resequence", "resumable", "rollback", "routingSlip", "saga", "sample", "script", "setBody", "setExchangePattern", "setHeader", "setHeaders", "setProperty", "setVariable", "setVariables", "sort", "split", "step", "stop", "threads", "throttle", "throwException", "to", "toD", "tokenizer", "transacted", "transform", "transformDataType", "unmarshal", "validate", "wireTap" ], "deprecated": false, "autowired": false, "secret": false }
+ "outputs": { "index": 5, "kind": "element", "displayName": "Outputs", "group": "common", "required": true, "type": "array", "javaType": "java.util.List", "oneOf": [ "a2aSubTask", "aggregate", "bean", "cache", "choice", "circuitBreaker", "claimCheck", "convertBodyTo", "convertHeaderTo", "convertVariableTo", "delay", "doCatch", "doFinally", "doTry", "dynamicRouter", "enrich", "filter", "idempotentConsumer", "intercept", "interceptFrom", "interceptSendToEndpoint", "kamelet", "loadBalance", "log", "loop", "marshal", "multicast", "onCompletion", "onException", "pausable", "pipeline", "policy", "poll", "pollEnrich", "process", "recipientList", "removeHeader", "removeHeaders", "removeProperties", "removeProperty", "removeVariable", "resequence", "resumable", "rollback", "routingSlip", "saga", "sample", "script", "setBody", "setExchangePattern", "setHeader", "setHeaders", "setProperty", "setVariable", "setVariables", "sort", "split", "step", "stop", "switch", "threads", "throttle", "throwException", "to", "toD", "tokenizer", "transacted", "transform", "transformDataType", "unmarshal", "validate", "wireTap" ], "deprecated": false, "autowired": false, "secret": false }
},
"exchangeProperties": {
"CamelInterceptedNodeId": { "index": 0, "kind": "exchangeProperty", "displayName": "Intercepted Node Id", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "autowired": false, "secret": false, "description": "The intercepted route's node ID" },
diff --git a/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/interceptFrom.json b/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/interceptFrom.json
index 799330919f7a6..0e1c4ff4c2706 100644
--- a/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/interceptFrom.json
+++ b/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/interceptFrom.json
@@ -18,7 +18,7 @@
"disabled": { "index": 3, "kind": "attribute", "displayName": "Disabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether to disable this EIP from the route during build time. Once an EIP has been disabled then it cannot be enabled later at runtime." },
"uri": { "index": 4, "kind": "attribute", "displayName": "Uri", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Intercept incoming messages from the uri or uri pattern. If not configured, then all incoming messages are intercepted." },
"onWhen": { "index": 5, "kind": "element", "displayName": "On When", "group": "common", "required": false, "type": "object", "javaType": "org.apache.camel.model.OnWhenDefinition", "deprecated": false, "autowired": false, "secret": false, "asPredicate": true, "description": "To use an expression to only trigger intercepting in specific situations" },
- "outputs": { "index": 6, "kind": "element", "displayName": "Outputs", "group": "common", "required": true, "type": "array", "javaType": "java.util.List", "oneOf": [ "a2aSubTask", "aggregate", "bean", "cache", "choice", "circuitBreaker", "claimCheck", "convertBodyTo", "convertHeaderTo", "convertVariableTo", "delay", "doCatch", "doFinally", "doTry", "dynamicRouter", "enrich", "filter", "idempotentConsumer", "intercept", "interceptFrom", "interceptSendToEndpoint", "kamelet", "loadBalance", "log", "loop", "marshal", "multicast", "onCompletion", "onException", "pausable", "pipeline", "policy", "poll", "pollEnrich", "process", "recipientList", "removeHeader", "removeHeaders", "removeProperties", "removeProperty", "removeVariable", "resequence", "resumable", "rollback", "routingSlip", "saga", "sample", "script", "setBody", "setExchangePattern", "setHeader", "setHeaders", "setProperty", "setVariable", "setVariables", "sort", "split", "step", "stop", "threads", "throttle", "throwException", "to", "toD", "tokenizer", "transacted", "transform", "transformDataType", "unmarshal", "validate", "wireTap" ], "deprecated": false, "autowired": false, "secret": false }
+ "outputs": { "index": 6, "kind": "element", "displayName": "Outputs", "group": "common", "required": true, "type": "array", "javaType": "java.util.List", "oneOf": [ "a2aSubTask", "aggregate", "bean", "cache", "choice", "circuitBreaker", "claimCheck", "convertBodyTo", "convertHeaderTo", "convertVariableTo", "delay", "doCatch", "doFinally", "doTry", "dynamicRouter", "enrich", "filter", "idempotentConsumer", "intercept", "interceptFrom", "interceptSendToEndpoint", "kamelet", "loadBalance", "log", "loop", "marshal", "multicast", "onCompletion", "onException", "pausable", "pipeline", "policy", "poll", "pollEnrich", "process", "recipientList", "removeHeader", "removeHeaders", "removeProperties", "removeProperty", "removeVariable", "resequence", "resumable", "rollback", "routingSlip", "saga", "sample", "script", "setBody", "setExchangePattern", "setHeader", "setHeaders", "setProperty", "setVariable", "setVariables", "sort", "split", "step", "stop", "switch", "threads", "throttle", "throwException", "to", "toD", "tokenizer", "transacted", "transform", "transformDataType", "unmarshal", "validate", "wireTap" ], "deprecated": false, "autowired": false, "secret": false }
},
"exchangeProperties": {
"CamelInterceptedEndpoint": { "index": 0, "kind": "exchangeProperty", "displayName": "Intercepted Endpoint", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "autowired": false, "secret": false, "description": "The endpoint URI that was intercepted" },
diff --git a/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/interceptSendToEndpoint.json b/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/interceptSendToEndpoint.json
index 45ed39b6cbfb8..98f5399696b87 100644
--- a/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/interceptSendToEndpoint.json
+++ b/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/interceptSendToEndpoint.json
@@ -20,7 +20,7 @@
"skipSendToOriginalEndpoint": { "index": 5, "kind": "attribute", "displayName": "Skip Send To Original Endpoint", "group": "common", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether to skip sending the message to the original endpoint. By default, the message is both intercepted and then sent to the original endpoint." },
"afterUri": { "index": 6, "kind": "attribute", "displayName": "After Uri", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "After sending to the endpoint then send the message to this uri which allows to process its result." },
"onWhen": { "index": 7, "kind": "element", "displayName": "On When", "group": "common", "required": false, "type": "object", "javaType": "org.apache.camel.model.OnWhenDefinition", "deprecated": false, "autowired": false, "secret": false, "asPredicate": true, "description": "To use an expression to only trigger intercepting sending to an endpoint in specific situations" },
- "outputs": { "index": 8, "kind": "element", "displayName": "Outputs", "group": "common", "required": true, "type": "array", "javaType": "java.util.List", "oneOf": [ "a2aSubTask", "aggregate", "bean", "cache", "choice", "circuitBreaker", "claimCheck", "convertBodyTo", "convertHeaderTo", "convertVariableTo", "delay", "doCatch", "doFinally", "doTry", "dynamicRouter", "enrich", "filter", "idempotentConsumer", "intercept", "interceptFrom", "interceptSendToEndpoint", "kamelet", "loadBalance", "log", "loop", "marshal", "multicast", "onCompletion", "onException", "pausable", "pipeline", "policy", "poll", "pollEnrich", "process", "recipientList", "removeHeader", "removeHeaders", "removeProperties", "removeProperty", "removeVariable", "resequence", "resumable", "rollback", "routingSlip", "saga", "sample", "script", "setBody", "setExchangePattern", "setHeader", "setHeaders", "setProperty", "setVariable", "setVariables", "sort", "split", "step", "stop", "threads", "throttle", "throwException", "to", "toD", "tokenizer", "transacted", "transform", "transformDataType", "unmarshal", "validate", "wireTap" ], "deprecated": false, "autowired": false, "secret": false }
+ "outputs": { "index": 8, "kind": "element", "displayName": "Outputs", "group": "common", "required": true, "type": "array", "javaType": "java.util.List", "oneOf": [ "a2aSubTask", "aggregate", "bean", "cache", "choice", "circuitBreaker", "claimCheck", "convertBodyTo", "convertHeaderTo", "convertVariableTo", "delay", "doCatch", "doFinally", "doTry", "dynamicRouter", "enrich", "filter", "idempotentConsumer", "intercept", "interceptFrom", "interceptSendToEndpoint", "kamelet", "loadBalance", "log", "loop", "marshal", "multicast", "onCompletion", "onException", "pausable", "pipeline", "policy", "poll", "pollEnrich", "process", "recipientList", "removeHeader", "removeHeaders", "removeProperties", "removeProperty", "removeVariable", "resequence", "resumable", "rollback", "routingSlip", "saga", "sample", "script", "setBody", "setExchangePattern", "setHeader", "setHeaders", "setProperty", "setVariable", "setVariables", "sort", "split", "step", "stop", "switch", "threads", "throttle", "throwException", "to", "toD", "tokenizer", "transacted", "transform", "transformDataType", "unmarshal", "validate", "wireTap" ], "deprecated": false, "autowired": false, "secret": false }
},
"exchangeProperties": {
"CamelInterceptedEndpoint": { "index": 0, "kind": "exchangeProperty", "displayName": "Intercepted Endpoint", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "autowired": false, "secret": false, "description": "The endpoint URI that was intercepted" },
diff --git a/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/kamelet.json b/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/kamelet.json
index cd8c43e1beacc..1d0749b2d5e10 100644
--- a/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/kamelet.json
+++ b/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/kamelet.json
@@ -17,6 +17,6 @@
"description": { "index": 2, "kind": "attribute", "displayName": "Description", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The description for this node" },
"disabled": { "index": 3, "kind": "attribute", "displayName": "Disabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether to disable this EIP from the route during build time. Once an EIP has been disabled then it cannot be enabled later at runtime." },
"name": { "index": 4, "kind": "attribute", "displayName": "Name", "group": "common", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Name of the Kamelet (templateId\/routeId) to call. Options for the kamelet can be specified using uri syntax, eg mynamecount=4&type=gold." },
- "outputs": { "index": 5, "kind": "element", "displayName": "Outputs", "group": "common", "required": true, "type": "array", "javaType": "java.util.List", "oneOf": [ "a2aSubTask", "aggregate", "bean", "cache", "choice", "circuitBreaker", "claimCheck", "convertBodyTo", "convertHeaderTo", "convertVariableTo", "delay", "doCatch", "doFinally", "doTry", "dynamicRouter", "enrich", "filter", "idempotentConsumer", "intercept", "interceptFrom", "interceptSendToEndpoint", "kamelet", "loadBalance", "log", "loop", "marshal", "multicast", "onCompletion", "onException", "pausable", "pipeline", "policy", "poll", "pollEnrich", "process", "recipientList", "removeHeader", "removeHeaders", "removeProperties", "removeProperty", "removeVariable", "resequence", "resumable", "rollback", "routingSlip", "saga", "sample", "script", "setBody", "setExchangePattern", "setHeader", "setHeaders", "setProperty", "setVariable", "setVariables", "sort", "split", "step", "stop", "threads", "throttle", "throwException", "to", "toD", "tokenizer", "transacted", "transform", "transformDataType", "unmarshal", "validate", "wireTap" ], "deprecated": false, "autowired": false, "secret": false }
+ "outputs": { "index": 5, "kind": "element", "displayName": "Outputs", "group": "common", "required": true, "type": "array", "javaType": "java.util.List", "oneOf": [ "a2aSubTask", "aggregate", "bean", "cache", "choice", "circuitBreaker", "claimCheck", "convertBodyTo", "convertHeaderTo", "convertVariableTo", "delay", "doCatch", "doFinally", "doTry", "dynamicRouter", "enrich", "filter", "idempotentConsumer", "intercept", "interceptFrom", "interceptSendToEndpoint", "kamelet", "loadBalance", "log", "loop", "marshal", "multicast", "onCompletion", "onException", "pausable", "pipeline", "policy", "poll", "pollEnrich", "process", "recipientList", "removeHeader", "removeHeaders", "removeProperties", "removeProperty", "removeVariable", "resequence", "resumable", "rollback", "routingSlip", "saga", "sample", "script", "setBody", "setExchangePattern", "setHeader", "setHeaders", "setProperty", "setVariable", "setVariables", "sort", "split", "step", "stop", "switch", "threads", "throttle", "throwException", "to", "toD", "tokenizer", "transacted", "transform", "transformDataType", "unmarshal", "validate", "wireTap" ], "deprecated": false, "autowired": false, "secret": false }
}
}
diff --git a/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/loadBalance.json b/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/loadBalance.json
index de65c909bd967..29654577a69fb 100644
--- a/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/loadBalance.json
+++ b/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/loadBalance.json
@@ -18,6 +18,6 @@
"description": { "index": 2, "kind": "attribute", "displayName": "Description", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The description for this node" },
"disabled": { "index": 3, "kind": "attribute", "displayName": "Disabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether to disable this EIP from the route during build time. Once an EIP has been disabled then it cannot be enabled later at runtime." },
"loadBalancerType": { "index": 4, "kind": "element", "displayName": "Load Balancer Type", "group": "common", "required": true, "type": "object", "javaType": "org.apache.camel.model.LoadBalancerDefinition", "oneOf": [ "customLoadBalancer", "failoverLoadBalancer", "randomLoadBalancer", "roundRobinLoadBalancer", "stickyLoadBalancer", "topicLoadBalancer", "weightedLoadBalancer" ], "deprecated": false, "autowired": false, "secret": false, "description": "The load balancing strategy to use, such as round-robin, random, sticky, topic, failover, weighted, or a custom load balancer." },
- "outputs": { "index": 5, "kind": "element", "displayName": "Outputs", "group": "common", "required": true, "type": "array", "javaType": "java.util.List", "oneOf": [ "a2aSubTask", "aggregate", "bean", "cache", "choice", "circuitBreaker", "claimCheck", "convertBodyTo", "convertHeaderTo", "convertVariableTo", "delay", "doCatch", "doFinally", "doTry", "dynamicRouter", "enrich", "filter", "idempotentConsumer", "intercept", "interceptFrom", "interceptSendToEndpoint", "kamelet", "loadBalance", "log", "loop", "marshal", "multicast", "onCompletion", "onException", "pausable", "pipeline", "policy", "poll", "pollEnrich", "process", "recipientList", "removeHeader", "removeHeaders", "removeProperties", "removeProperty", "removeVariable", "resequence", "resumable", "rollback", "routingSlip", "saga", "sample", "script", "setBody", "setExchangePattern", "setHeader", "setHeaders", "setProperty", "setVariable", "setVariables", "sort", "split", "step", "stop", "threads", "throttle", "throwException", "to", "toD", "tokenizer", "transacted", "transform", "transformDataType", "unmarshal", "validate", "wireTap" ], "deprecated": false, "autowired": false, "secret": false }
+ "outputs": { "index": 5, "kind": "element", "displayName": "Outputs", "group": "common", "required": true, "type": "array", "javaType": "java.util.List", "oneOf": [ "a2aSubTask", "aggregate", "bean", "cache", "choice", "circuitBreaker", "claimCheck", "convertBodyTo", "convertHeaderTo", "convertVariableTo", "delay", "doCatch", "doFinally", "doTry", "dynamicRouter", "enrich", "filter", "idempotentConsumer", "intercept", "interceptFrom", "interceptSendToEndpoint", "kamelet", "loadBalance", "log", "loop", "marshal", "multicast", "onCompletion", "onException", "pausable", "pipeline", "policy", "poll", "pollEnrich", "process", "recipientList", "removeHeader", "removeHeaders", "removeProperties", "removeProperty", "removeVariable", "resequence", "resumable", "rollback", "routingSlip", "saga", "sample", "script", "setBody", "setExchangePattern", "setHeader", "setHeaders", "setProperty", "setVariable", "setVariables", "sort", "split", "step", "stop", "switch", "threads", "throttle", "throwException", "to", "toD", "tokenizer", "transacted", "transform", "transformDataType", "unmarshal", "validate", "wireTap" ], "deprecated": false, "autowired": false, "secret": false }
}
}
diff --git a/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/loop.json b/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/loop.json
index 333d1d3cad860..08cffb3e6a881 100644
--- a/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/loop.json
+++ b/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/loop.json
@@ -22,7 +22,7 @@
"doWhile": { "index": 6, "kind": "attribute", "displayName": "Do While", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Enables the while loop that loops until the predicate evaluates to false or null." },
"breakOnShutdown": { "index": 7, "kind": "attribute", "displayName": "Break On Shutdown", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "If enabled, the loop will not iterate until it reaches the end when Camel is shut down." },
"onPrepare": { "index": 8, "kind": "attribute", "displayName": "On Prepare", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.Processor", "deprecated": false, "autowired": false, "secret": false, "description": "Uses a processor when preparing the exchange for each loop iteration. This can be used to deep-clone messages, or any custom logic needed before the looping executes." },
- "outputs": { "index": 9, "kind": "element", "displayName": "Outputs", "group": "common", "required": true, "type": "array", "javaType": "java.util.List>", "oneOf": [ "a2aSubTask", "aggregate", "bean", "cache", "choice", "circuitBreaker", "claimCheck", "convertBodyTo", "convertHeaderTo", "convertVariableTo", "delay", "doCatch", "doFinally", "doTry", "dynamicRouter", "enrich", "filter", "idempotentConsumer", "intercept", "interceptFrom", "interceptSendToEndpoint", "kamelet", "loadBalance", "log", "loop", "marshal", "multicast", "onCompletion", "onException", "pausable", "pipeline", "policy", "poll", "pollEnrich", "process", "recipientList", "removeHeader", "removeHeaders", "removeProperties", "removeProperty", "removeVariable", "resequence", "resumable", "rollback", "routingSlip", "saga", "sample", "script", "setBody", "setExchangePattern", "setHeader", "setHeaders", "setProperty", "setVariable", "setVariables", "sort", "split", "step", "stop", "threads", "throttle", "throwException", "to", "toD", "tokenizer", "transacted", "transform", "transformDataType", "unmarshal", "validate", "wireTap" ], "deprecated": false, "autowired": false, "secret": false }
+ "outputs": { "index": 9, "kind": "element", "displayName": "Outputs", "group": "common", "required": true, "type": "array", "javaType": "java.util.List>", "oneOf": [ "a2aSubTask", "aggregate", "bean", "cache", "choice", "circuitBreaker", "claimCheck", "convertBodyTo", "convertHeaderTo", "convertVariableTo", "delay", "doCatch", "doFinally", "doTry", "dynamicRouter", "enrich", "filter", "idempotentConsumer", "intercept", "interceptFrom", "interceptSendToEndpoint", "kamelet", "loadBalance", "log", "loop", "marshal", "multicast", "onCompletion", "onException", "pausable", "pipeline", "policy", "poll", "pollEnrich", "process", "recipientList", "removeHeader", "removeHeaders", "removeProperties", "removeProperty", "removeVariable", "resequence", "resumable", "rollback", "routingSlip", "saga", "sample", "script", "setBody", "setExchangePattern", "setHeader", "setHeaders", "setProperty", "setVariable", "setVariables", "sort", "split", "step", "stop", "switch", "threads", "throttle", "throwException", "to", "toD", "tokenizer", "transacted", "transform", "transformDataType", "unmarshal", "validate", "wireTap" ], "deprecated": false, "autowired": false, "secret": false }
},
"exchangeProperties": {
"CamelLoopIndex": { "index": 0, "kind": "exchangeProperty", "displayName": "Loop Index", "label": "producer", "required": false, "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "description": "Index of the current iteration (0 based)." },
diff --git a/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/multicast.json b/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/multicast.json
index 37d9cd457cd2c..29f44c5b3e1c4 100644
--- a/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/multicast.json
+++ b/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/multicast.json
@@ -29,7 +29,7 @@
"executorService": { "index": 13, "kind": "attribute", "displayName": "Executor Service", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "java.util.concurrent.ExecutorService", "deprecated": false, "autowired": false, "secret": false, "description": "Reference to a custom thread pool to use for parallel processing. Setting this option implies parallel processing." },
"onPrepare": { "index": 14, "kind": "attribute", "displayName": "On Prepare", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.Processor", "deprecated": false, "autowired": false, "secret": false, "description": "Reference to a processor for preparing the exchange to be sent. Can be used to deep-clone messages that should be sent." },
"shareUnitOfWork": { "index": 15, "kind": "attribute", "displayName": "Share Unit Of Work", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Shares the unit of work with the parent and each of the multicast exchanges. By default each multicast exchange has its own individual unit of work." },
- "outputs": { "index": 16, "kind": "element", "displayName": "Outputs", "group": "common", "required": true, "type": "array", "javaType": "java.util.List", "oneOf": [ "a2aSubTask", "aggregate", "bean", "cache", "choice", "circuitBreaker", "claimCheck", "convertBodyTo", "convertHeaderTo", "convertVariableTo", "delay", "doCatch", "doFinally", "doTry", "dynamicRouter", "enrich", "filter", "idempotentConsumer", "intercept", "interceptFrom", "interceptSendToEndpoint", "kamelet", "loadBalance", "log", "loop", "marshal", "multicast", "onCompletion", "onException", "pausable", "pipeline", "policy", "poll", "pollEnrich", "process", "recipientList", "removeHeader", "removeHeaders", "removeProperties", "removeProperty", "removeVariable", "resequence", "resumable", "rollback", "routingSlip", "saga", "sample", "script", "setBody", "setExchangePattern", "setHeader", "setHeaders", "setProperty", "setVariable", "setVariables", "sort", "split", "step", "stop", "threads", "throttle", "throwException", "to", "toD", "tokenizer", "transacted", "transform", "transformDataType", "unmarshal", "validate", "wireTap" ], "deprecated": false, "autowired": false, "secret": false }
+ "outputs": { "index": 16, "kind": "element", "displayName": "Outputs", "group": "common", "required": true, "type": "array", "javaType": "java.util.List", "oneOf": [ "a2aSubTask", "aggregate", "bean", "cache", "choice", "circuitBreaker", "claimCheck", "convertBodyTo", "convertHeaderTo", "convertVariableTo", "delay", "doCatch", "doFinally", "doTry", "dynamicRouter", "enrich", "filter", "idempotentConsumer", "intercept", "interceptFrom", "interceptSendToEndpoint", "kamelet", "loadBalance", "log", "loop", "marshal", "multicast", "onCompletion", "onException", "pausable", "pipeline", "policy", "poll", "pollEnrich", "process", "recipientList", "removeHeader", "removeHeaders", "removeProperties", "removeProperty", "removeVariable", "resequence", "resumable", "rollback", "routingSlip", "saga", "sample", "script", "setBody", "setExchangePattern", "setHeader", "setHeaders", "setProperty", "setVariable", "setVariables", "sort", "split", "step", "stop", "switch", "threads", "throttle", "throwException", "to", "toD", "tokenizer", "transacted", "transform", "transformDataType", "unmarshal", "validate", "wireTap" ], "deprecated": false, "autowired": false, "secret": false }
},
"exchangeProperties": {
"CamelMulticastIndex": { "index": 0, "kind": "exchangeProperty", "displayName": "Multicast Index", "label": "producer", "required": false, "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "description": "An index counter that increases for each Exchange being multicasted. The counter starts from 0." },
diff --git a/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/onCompletion.json b/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/onCompletion.json
index ffb6fa48a43d9..262a77cea7fc1 100644
--- a/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/onCompletion.json
+++ b/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/onCompletion.json
@@ -23,7 +23,7 @@
"executorService": { "index": 8, "kind": "attribute", "displayName": "Executor Service", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "java.util.concurrent.ExecutorService", "deprecated": false, "autowired": false, "secret": false, "description": "Refers to a custom Thread Pool to be used for parallel processing. Notice if you set this option, then parallel processing is automatically implied, and you do not have to enable that option as well." },
"useOriginalMessage": { "index": 9, "kind": "attribute", "displayName": "Use Original Message", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Will use the original input message when an Exchange for this on completion. By default this feature is off." },
"onWhen": { "index": 10, "kind": "element", "displayName": "On When", "group": "common", "required": false, "type": "object", "javaType": "org.apache.camel.model.OnWhenDefinition", "deprecated": false, "autowired": false, "secret": false, "asPredicate": true, "description": "To use an expression to only trigger routing this completion steps in specific situations" },
- "outputs": { "index": 11, "kind": "element", "displayName": "Outputs", "group": "common", "required": true, "type": "array", "javaType": "java.util.List", "oneOf": [ "a2aSubTask", "aggregate", "bean", "cache", "choice", "circuitBreaker", "claimCheck", "convertBodyTo", "convertHeaderTo", "convertVariableTo", "delay", "doCatch", "doFinally", "doTry", "dynamicRouter", "enrich", "filter", "idempotentConsumer", "intercept", "interceptFrom", "interceptSendToEndpoint", "kamelet", "loadBalance", "log", "loop", "marshal", "multicast", "onCompletion", "onException", "pausable", "pipeline", "policy", "poll", "pollEnrich", "process", "recipientList", "removeHeader", "removeHeaders", "removeProperties", "removeProperty", "removeVariable", "resequence", "resumable", "rollback", "routingSlip", "saga", "sample", "script", "setBody", "setExchangePattern", "setHeader", "setHeaders", "setProperty", "setVariable", "setVariables", "sort", "split", "step", "stop", "threads", "throttle", "throwException", "to", "toD", "tokenizer", "transacted", "transform", "transformDataType", "unmarshal", "validate", "wireTap" ], "deprecated": false, "autowired": false, "secret": false }
+ "outputs": { "index": 11, "kind": "element", "displayName": "Outputs", "group": "common", "required": true, "type": "array", "javaType": "java.util.List", "oneOf": [ "a2aSubTask", "aggregate", "bean", "cache", "choice", "circuitBreaker", "claimCheck", "convertBodyTo", "convertHeaderTo", "convertVariableTo", "delay", "doCatch", "doFinally", "doTry", "dynamicRouter", "enrich", "filter", "idempotentConsumer", "intercept", "interceptFrom", "interceptSendToEndpoint", "kamelet", "loadBalance", "log", "loop", "marshal", "multicast", "onCompletion", "onException", "pausable", "pipeline", "policy", "poll", "pollEnrich", "process", "recipientList", "removeHeader", "removeHeaders", "removeProperties", "removeProperty", "removeVariable", "resequence", "resumable", "rollback", "routingSlip", "saga", "sample", "script", "setBody", "setExchangePattern", "setHeader", "setHeaders", "setProperty", "setVariable", "setVariables", "sort", "split", "step", "stop", "switch", "threads", "throttle", "throwException", "to", "toD", "tokenizer", "transacted", "transform", "transformDataType", "unmarshal", "validate", "wireTap" ], "deprecated": false, "autowired": false, "secret": false }
},
"exchangeProperties": {
"CamelOnCompletion": { "index": 0, "kind": "exchangeProperty", "displayName": "On Completion", "label": "producer", "required": false, "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "description": "Flag to mark that this exchange is currently being executed as onCompletion" }
diff --git a/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/onException.json b/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/onException.json
index 886d297162cbe..e0ed0003e5046 100644
--- a/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/onException.json
+++ b/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/onException.json
@@ -27,7 +27,7 @@
"onExceptionOccurredRef": { "index": 12, "kind": "attribute", "displayName": "On Exception Occurred Ref", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Sets a reference to a processor that is invoked just after an exception occurred. Can be used to perform custom logging. Any exception thrown from this processor is ignored." },
"useOriginalMessage": { "index": 13, "kind": "attribute", "displayName": "Use Original Message", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "If enabled, uses the original input message (body and headers) when the exchange is moved to the dead letter queue after all redelivery attempts have been exhausted. Cannot be used together with useOriginalBody." },
"useOriginalBody": { "index": 14, "kind": "attribute", "displayName": "Use Original Body", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "If enabled, uses the original input message body (but not headers) when the exchange is moved to the dead letter queue after all redelivery attempts have been exhausted. This allows enriching the message with custom headers while keeping the original body. Cannot be used together with useOriginalMessage." },
- "outputs": { "index": 15, "kind": "element", "displayName": "Outputs", "group": "common", "required": true, "type": "array", "javaType": "java.util.List", "oneOf": [ "a2aSubTask", "aggregate", "bean", "cache", "choice", "circuitBreaker", "claimCheck", "convertBodyTo", "convertHeaderTo", "convertVariableTo", "delay", "doCatch", "doFinally", "doTry", "dynamicRouter", "enrich", "filter", "idempotentConsumer", "intercept", "interceptFrom", "interceptSendToEndpoint", "kamelet", "loadBalance", "log", "loop", "marshal", "multicast", "onCompletion", "onException", "pausable", "pipeline", "policy", "poll", "pollEnrich", "process", "recipientList", "removeHeader", "removeHeaders", "removeProperties", "removeProperty", "removeVariable", "resequence", "resumable", "rollback", "routingSlip", "saga", "sample", "script", "setBody", "setExchangePattern", "setHeader", "setHeaders", "setProperty", "setVariable", "setVariables", "sort", "split", "step", "stop", "threads", "throttle", "throwException", "to", "toD", "tokenizer", "transacted", "transform", "transformDataType", "unmarshal", "validate", "wireTap" ], "deprecated": false, "autowired": false, "secret": false }
+ "outputs": { "index": 15, "kind": "element", "displayName": "Outputs", "group": "common", "required": true, "type": "array", "javaType": "java.util.List", "oneOf": [ "a2aSubTask", "aggregate", "bean", "cache", "choice", "circuitBreaker", "claimCheck", "convertBodyTo", "convertHeaderTo", "convertVariableTo", "delay", "doCatch", "doFinally", "doTry", "dynamicRouter", "enrich", "filter", "idempotentConsumer", "intercept", "interceptFrom", "interceptSendToEndpoint", "kamelet", "loadBalance", "log", "loop", "marshal", "multicast", "onCompletion", "onException", "pausable", "pipeline", "policy", "poll", "pollEnrich", "process", "recipientList", "removeHeader", "removeHeaders", "removeProperties", "removeProperty", "removeVariable", "resequence", "resumable", "rollback", "routingSlip", "saga", "sample", "script", "setBody", "setExchangePattern", "setHeader", "setHeaders", "setProperty", "setVariable", "setVariables", "sort", "split", "step", "stop", "switch", "threads", "throttle", "throwException", "to", "toD", "tokenizer", "transacted", "transform", "transformDataType", "unmarshal", "validate", "wireTap" ], "deprecated": false, "autowired": false, "secret": false }
},
"exchangeProperties": {
"CamelExceptionCaught": { "index": 0, "kind": "exchangeProperty", "displayName": "Exception Caught", "label": "producer", "required": false, "javaType": "java.lang.Exception", "deprecated": false, "autowired": false, "secret": false, "description": "Stores the caught exception due to a processing error of the current Exchange" },
diff --git a/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/onFallback.json b/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/onFallback.json
index fda944929370d..839e56088a003 100644
--- a/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/onFallback.json
+++ b/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/onFallback.json
@@ -17,6 +17,6 @@
"note": { "index": 1, "kind": "attribute", "displayName": "Note", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The note for this node" },
"description": { "index": 2, "kind": "attribute", "displayName": "Description", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The description for this node" },
"fallbackViaNetwork": { "index": 3, "kind": "attribute", "displayName": "Fallback Via Network", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": true, "deprecationNote": "Not supported by any circuit breaker implementation.", "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the fallback goes over the network. If so, the fallback is executed on a separate thread-pool to avoid exhausting the main thread-pool." },
- "outputs": { "index": 4, "kind": "element", "displayName": "Outputs", "group": "common", "required": true, "type": "array", "javaType": "java.util.List>", "oneOf": [ "a2aSubTask", "aggregate", "bean", "cache", "choice", "circuitBreaker", "claimCheck", "convertBodyTo", "convertHeaderTo", "convertVariableTo", "delay", "doCatch", "doFinally", "doTry", "dynamicRouter", "enrich", "filter", "idempotentConsumer", "intercept", "interceptFrom", "interceptSendToEndpoint", "kamelet", "loadBalance", "log", "loop", "marshal", "multicast", "onCompletion", "onException", "pausable", "pipeline", "policy", "poll", "pollEnrich", "process", "recipientList", "removeHeader", "removeHeaders", "removeProperties", "removeProperty", "removeVariable", "resequence", "resumable", "rollback", "routingSlip", "saga", "sample", "script", "setBody", "setExchangePattern", "setHeader", "setHeaders", "setProperty", "setVariable", "setVariables", "sort", "split", "step", "stop", "threads", "throttle", "throwException", "to", "toD", "tokenizer", "transacted", "transform", "transformDataType", "unmarshal", "validate", "wireTap" ], "deprecated": false, "autowired": false, "secret": false }
+ "outputs": { "index": 4, "kind": "element", "displayName": "Outputs", "group": "common", "required": true, "type": "array", "javaType": "java.util.List>", "oneOf": [ "a2aSubTask", "aggregate", "bean", "cache", "choice", "circuitBreaker", "claimCheck", "convertBodyTo", "convertHeaderTo", "convertVariableTo", "delay", "doCatch", "doFinally", "doTry", "dynamicRouter", "enrich", "filter", "idempotentConsumer", "intercept", "interceptFrom", "interceptSendToEndpoint", "kamelet", "loadBalance", "log", "loop", "marshal", "multicast", "onCompletion", "onException", "pausable", "pipeline", "policy", "poll", "pollEnrich", "process", "recipientList", "removeHeader", "removeHeaders", "removeProperties", "removeProperty", "removeVariable", "resequence", "resumable", "rollback", "routingSlip", "saga", "sample", "script", "setBody", "setExchangePattern", "setHeader", "setHeaders", "setProperty", "setVariable", "setVariables", "sort", "split", "step", "stop", "switch", "threads", "throttle", "throwException", "to", "toD", "tokenizer", "transacted", "transform", "transformDataType", "unmarshal", "validate", "wireTap" ], "deprecated": false, "autowired": false, "secret": false }
}
}
diff --git a/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/otherwise.json b/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/otherwise.json
index 201bd53c297c5..41494913752ff 100644
--- a/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/otherwise.json
+++ b/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/otherwise.json
@@ -16,6 +16,6 @@
"note": { "index": 1, "kind": "attribute", "displayName": "Note", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The note for this node" },
"description": { "index": 2, "kind": "attribute", "displayName": "Description", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The description for this node" },
"disabled": { "index": 3, "kind": "attribute", "displayName": "Disabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Disables this EIP from the route." },
- "outputs": { "index": 4, "kind": "element", "displayName": "Outputs", "group": "common", "required": true, "type": "array", "javaType": "java.util.List>", "oneOf": [ "a2aSubTask", "aggregate", "bean", "cache", "choice", "circuitBreaker", "claimCheck", "convertBodyTo", "convertHeaderTo", "convertVariableTo", "delay", "doCatch", "doFinally", "doTry", "dynamicRouter", "enrich", "filter", "idempotentConsumer", "intercept", "interceptFrom", "interceptSendToEndpoint", "kamelet", "loadBalance", "log", "loop", "marshal", "multicast", "onCompletion", "onException", "pausable", "pipeline", "policy", "poll", "pollEnrich", "process", "recipientList", "removeHeader", "removeHeaders", "removeProperties", "removeProperty", "removeVariable", "resequence", "resumable", "rollback", "routingSlip", "saga", "sample", "script", "setBody", "setExchangePattern", "setHeader", "setHeaders", "setProperty", "setVariable", "setVariables", "sort", "split", "step", "stop", "threads", "throttle", "throwException", "to", "toD", "tokenizer", "transacted", "transform", "transformDataType", "unmarshal", "validate", "wireTap" ], "deprecated": false, "autowired": false, "secret": false }
+ "outputs": { "index": 4, "kind": "element", "displayName": "Outputs", "group": "common", "required": true, "type": "array", "javaType": "java.util.List>", "oneOf": [ "a2aSubTask", "aggregate", "bean", "cache", "choice", "circuitBreaker", "claimCheck", "convertBodyTo", "convertHeaderTo", "convertVariableTo", "delay", "doCatch", "doFinally", "doTry", "dynamicRouter", "enrich", "filter", "idempotentConsumer", "intercept", "interceptFrom", "interceptSendToEndpoint", "kamelet", "loadBalance", "log", "loop", "marshal", "multicast", "onCompletion", "onException", "pausable", "pipeline", "policy", "poll", "pollEnrich", "process", "recipientList", "removeHeader", "removeHeaders", "removeProperties", "removeProperty", "removeVariable", "resequence", "resumable", "rollback", "routingSlip", "saga", "sample", "script", "setBody", "setExchangePattern", "setHeader", "setHeaders", "setProperty", "setVariable", "setVariables", "sort", "split", "step", "stop", "switch", "threads", "throttle", "throwException", "to", "toD", "tokenizer", "transacted", "transform", "transformDataType", "unmarshal", "validate", "wireTap" ], "deprecated": false, "autowired": false, "secret": false }
}
}
diff --git a/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/pipeline.json b/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/pipeline.json
index 8c2e503fed5c7..3c5106ddb4855 100644
--- a/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/pipeline.json
+++ b/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/pipeline.json
@@ -17,6 +17,6 @@
"note": { "index": 1, "kind": "attribute", "displayName": "Note", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The note for this node" },
"description": { "index": 2, "kind": "attribute", "displayName": "Description", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The description for this node" },
"disabled": { "index": 3, "kind": "attribute", "displayName": "Disabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether to disable this EIP from the route during build time. Once an EIP has been disabled then it cannot be enabled later at runtime." },
- "outputs": { "index": 4, "kind": "element", "displayName": "Outputs", "group": "common", "required": true, "type": "array", "javaType": "java.util.List", "oneOf": [ "a2aSubTask", "aggregate", "bean", "cache", "choice", "circuitBreaker", "claimCheck", "convertBodyTo", "convertHeaderTo", "convertVariableTo", "delay", "doCatch", "doFinally", "doTry", "dynamicRouter", "enrich", "filter", "idempotentConsumer", "intercept", "interceptFrom", "interceptSendToEndpoint", "kamelet", "loadBalance", "log", "loop", "marshal", "multicast", "onCompletion", "onException", "pausable", "pipeline", "policy", "poll", "pollEnrich", "process", "recipientList", "removeHeader", "removeHeaders", "removeProperties", "removeProperty", "removeVariable", "resequence", "resumable", "rollback", "routingSlip", "saga", "sample", "script", "setBody", "setExchangePattern", "setHeader", "setHeaders", "setProperty", "setVariable", "setVariables", "sort", "split", "step", "stop", "threads", "throttle", "throwException", "to", "toD", "tokenizer", "transacted", "transform", "transformDataType", "unmarshal", "validate", "wireTap" ], "deprecated": false, "autowired": false, "secret": false }
+ "outputs": { "index": 4, "kind": "element", "displayName": "Outputs", "group": "common", "required": true, "type": "array", "javaType": "java.util.List", "oneOf": [ "a2aSubTask", "aggregate", "bean", "cache", "choice", "circuitBreaker", "claimCheck", "convertBodyTo", "convertHeaderTo", "convertVariableTo", "delay", "doCatch", "doFinally", "doTry", "dynamicRouter", "enrich", "filter", "idempotentConsumer", "intercept", "interceptFrom", "interceptSendToEndpoint", "kamelet", "loadBalance", "log", "loop", "marshal", "multicast", "onCompletion", "onException", "pausable", "pipeline", "policy", "poll", "pollEnrich", "process", "recipientList", "removeHeader", "removeHeaders", "removeProperties", "removeProperty", "removeVariable", "resequence", "resumable", "rollback", "routingSlip", "saga", "sample", "script", "setBody", "setExchangePattern", "setHeader", "setHeaders", "setProperty", "setVariable", "setVariables", "sort", "split", "step", "stop", "switch", "threads", "throttle", "throwException", "to", "toD", "tokenizer", "transacted", "transform", "transformDataType", "unmarshal", "validate", "wireTap" ], "deprecated": false, "autowired": false, "secret": false }
}
}
diff --git a/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/resequence.json b/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/resequence.json
index 7cc32a64df664..a001f1f6d674c 100644
--- a/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/resequence.json
+++ b/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/resequence.json
@@ -18,6 +18,6 @@
"disabled": { "index": 3, "kind": "attribute", "displayName": "Disabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether to disable this EIP from the route during build time. Once an EIP has been disabled then it cannot be enabled later at runtime." },
"expression": { "index": 4, "kind": "expression", "displayName": "Expression", "group": "common", "required": true, "type": "object", "javaType": "org.apache.camel.model.language.ExpressionDefinition", "oneOf": [ "constant", "datasonnet", "exchangeProperty", "groovy", "header", "hl7terser", "jactl", "java", "jq", "js", "jsonpath", "language", "method", "mvel", "ognl", "python", "python3", "quickjs", "ref", "simple", "spel", "tokenize", "variable", "wasm", "xpath", "xquery", "xtokenize" ], "deprecated": false, "autowired": false, "secret": false, "description": "Expression to use for re-ordering the messages, such as a header with a sequence number." },
"resequencerConfig": { "index": 5, "kind": "element", "displayName": "Resequencer Config", "group": "common", "required": true, "type": "object", "javaType": "org.apache.camel.model.config.ResequencerConfig", "oneOf": [ "batchConfig", "streamConfig" ], "deprecated": false, "autowired": false, "secret": false, "description": "Resequencer configuration using either batch or stream mode. Defaults to batch mode." },
- "outputs": { "index": 6, "kind": "element", "displayName": "Outputs", "group": "common", "required": true, "type": "array", "javaType": "java.util.List", "oneOf": [ "a2aSubTask", "aggregate", "bean", "cache", "choice", "circuitBreaker", "claimCheck", "convertBodyTo", "convertHeaderTo", "convertVariableTo", "delay", "doCatch", "doFinally", "doTry", "dynamicRouter", "enrich", "filter", "idempotentConsumer", "intercept", "interceptFrom", "interceptSendToEndpoint", "kamelet", "loadBalance", "log", "loop", "marshal", "multicast", "onCompletion", "onException", "pausable", "pipeline", "policy", "poll", "pollEnrich", "process", "recipientList", "removeHeader", "removeHeaders", "removeProperties", "removeProperty", "removeVariable", "resequence", "resumable", "rollback", "routingSlip", "saga", "sample", "script", "setBody", "setExchangePattern", "setHeader", "setHeaders", "setProperty", "setVariable", "setVariables", "sort", "split", "step", "stop", "threads", "throttle", "throwException", "to", "toD", "tokenizer", "transacted", "transform", "transformDataType", "unmarshal", "validate", "wireTap" ], "deprecated": false, "autowired": false, "secret": false }
+ "outputs": { "index": 6, "kind": "element", "displayName": "Outputs", "group": "common", "required": true, "type": "array", "javaType": "java.util.List", "oneOf": [ "a2aSubTask", "aggregate", "bean", "cache", "choice", "circuitBreaker", "claimCheck", "convertBodyTo", "convertHeaderTo", "convertVariableTo", "delay", "doCatch", "doFinally", "doTry", "dynamicRouter", "enrich", "filter", "idempotentConsumer", "intercept", "interceptFrom", "interceptSendToEndpoint", "kamelet", "loadBalance", "log", "loop", "marshal", "multicast", "onCompletion", "onException", "pausable", "pipeline", "policy", "poll", "pollEnrich", "process", "recipientList", "removeHeader", "removeHeaders", "removeProperties", "removeProperty", "removeVariable", "resequence", "resumable", "rollback", "routingSlip", "saga", "sample", "script", "setBody", "setExchangePattern", "setHeader", "setHeaders", "setProperty", "setVariable", "setVariables", "sort", "split", "step", "stop", "switch", "threads", "throttle", "throwException", "to", "toD", "tokenizer", "transacted", "transform", "transformDataType", "unmarshal", "validate", "wireTap" ], "deprecated": false, "autowired": false, "secret": false }
}
}
diff --git a/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/route.json b/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/route.json
index 16356d0e9ad39..ad5d3453d0f70 100644
--- a/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/route.json
+++ b/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/route.json
@@ -34,6 +34,6 @@
"inputType": { "index": 19, "kind": "element", "displayName": "Input Type", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.model.InputTypeDefinition", "deprecated": false, "autowired": false, "secret": false, "description": "Declare the expected data type of the input message. If the actual message type is different at runtime, camel looks for a required Transformer and applies if exists." },
"outputType": { "index": 20, "kind": "element", "displayName": "Output Type", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.model.OutputTypeDefinition", "deprecated": false, "autowired": false, "secret": false, "description": "Declare the expected data type of the output message. If the actual message type is different at runtime, camel looks for a required Transformer and applies if exists." },
"input": { "index": 21, "kind": "element", "displayName": "Input", "group": "common", "required": true, "type": "object", "javaType": "org.apache.camel.model.FromDefinition", "oneOf": [ "from" ], "deprecated": false, "autowired": false, "secret": false, "description": "The input (from) endpoint that starts this route and acts as the consumer that receives incoming messages." },
- "outputs": { "index": 22, "kind": "element", "displayName": "Outputs", "group": "common", "required": true, "type": "array", "javaType": "java.util.List>", "oneOf": [ "a2aSubTask", "aggregate", "bean", "cache", "choice", "circuitBreaker", "claimCheck", "convertBodyTo", "convertHeaderTo", "convertVariableTo", "delay", "doCatch", "doFinally", "doTry", "dynamicRouter", "enrich", "filter", "idempotentConsumer", "intercept", "interceptFrom", "interceptSendToEndpoint", "kamelet", "loadBalance", "log", "loop", "marshal", "multicast", "onCompletion", "onException", "pausable", "pipeline", "policy", "poll", "pollEnrich", "process", "recipientList", "removeHeader", "removeHeaders", "removeProperties", "removeProperty", "removeVariable", "resequence", "resumable", "rollback", "routingSlip", "saga", "sample", "script", "setBody", "setExchangePattern", "setHeader", "setHeaders", "setProperty", "setVariable", "setVariables", "sort", "split", "step", "stop", "threads", "throttle", "throwException", "to", "toD", "tokenizer", "transacted", "transform", "transformDataType", "unmarshal", "validate", "wireTap" ], "deprecated": false, "autowired": false, "secret": false }
+ "outputs": { "index": 22, "kind": "element", "displayName": "Outputs", "group": "common", "required": true, "type": "array", "javaType": "java.util.List>", "oneOf": [ "a2aSubTask", "aggregate", "bean", "cache", "choice", "circuitBreaker", "claimCheck", "convertBodyTo", "convertHeaderTo", "convertVariableTo", "delay", "doCatch", "doFinally", "doTry", "dynamicRouter", "enrich", "filter", "idempotentConsumer", "intercept", "interceptFrom", "interceptSendToEndpoint", "kamelet", "loadBalance", "log", "loop", "marshal", "multicast", "onCompletion", "onException", "pausable", "pipeline", "policy", "poll", "pollEnrich", "process", "recipientList", "removeHeader", "removeHeaders", "removeProperties", "removeProperty", "removeVariable", "resequence", "resumable", "rollback", "routingSlip", "saga", "sample", "script", "setBody", "setExchangePattern", "setHeader", "setHeaders", "setProperty", "setVariable", "setVariables", "sort", "split", "step", "stop", "switch", "threads", "throttle", "throwException", "to", "toD", "tokenizer", "transacted", "transform", "transformDataType", "unmarshal", "validate", "wireTap" ], "deprecated": false, "autowired": false, "secret": false }
}
}
diff --git a/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/saga.json b/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/saga.json
index 0ea9948ae92c6..de47ff1502019 100644
--- a/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/saga.json
+++ b/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/saga.json
@@ -24,6 +24,6 @@
"compensation": { "index": 8, "kind": "attribute", "displayName": "Compensation", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The compensation endpoint URI that must be called to compensate all changes done in the route. The route corresponding to the compensation URI must perform compensation and complete without error." },
"completion": { "index": 9, "kind": "attribute", "displayName": "Completion", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The completion endpoint URI that will be called when the Saga is completed successfully. The route corresponding to the completion URI must perform completion tasks and terminate without error." },
"option": { "index": 10, "kind": "element", "displayName": "Option", "group": "advanced", "label": "advanced", "required": false, "type": "array", "javaType": "java.util.List", "deprecated": false, "autowired": false, "secret": false, "description": "Allows to save properties of the current exchange in order to re-use them in a compensation\/completion callback route. Option values will be transformed into input headers of the compensation\/completion exchange." },
- "outputs": { "index": 11, "kind": "element", "displayName": "Outputs", "group": "common", "required": true, "type": "array", "javaType": "java.util.List", "oneOf": [ "a2aSubTask", "aggregate", "bean", "cache", "choice", "circuitBreaker", "claimCheck", "convertBodyTo", "convertHeaderTo", "convertVariableTo", "delay", "doCatch", "doFinally", "doTry", "dynamicRouter", "enrich", "filter", "idempotentConsumer", "intercept", "interceptFrom", "interceptSendToEndpoint", "kamelet", "loadBalance", "log", "loop", "marshal", "multicast", "onCompletion", "onException", "pausable", "pipeline", "policy", "poll", "pollEnrich", "process", "recipientList", "removeHeader", "removeHeaders", "removeProperties", "removeProperty", "removeVariable", "resequence", "resumable", "rollback", "routingSlip", "saga", "sample", "script", "setBody", "setExchangePattern", "setHeader", "setHeaders", "setProperty", "setVariable", "setVariables", "sort", "split", "step", "stop", "threads", "throttle", "throwException", "to", "toD", "tokenizer", "transacted", "transform", "transformDataType", "unmarshal", "validate", "wireTap" ], "deprecated": false, "autowired": false, "secret": false }
+ "outputs": { "index": 11, "kind": "element", "displayName": "Outputs", "group": "common", "required": true, "type": "array", "javaType": "java.util.List", "oneOf": [ "a2aSubTask", "aggregate", "bean", "cache", "choice", "circuitBreaker", "claimCheck", "convertBodyTo", "convertHeaderTo", "convertVariableTo", "delay", "doCatch", "doFinally", "doTry", "dynamicRouter", "enrich", "filter", "idempotentConsumer", "intercept", "interceptFrom", "interceptSendToEndpoint", "kamelet", "loadBalance", "log", "loop", "marshal", "multicast", "onCompletion", "onException", "pausable", "pipeline", "policy", "poll", "pollEnrich", "process", "recipientList", "removeHeader", "removeHeaders", "removeProperties", "removeProperty", "removeVariable", "resequence", "resumable", "rollback", "routingSlip", "saga", "sample", "script", "setBody", "setExchangePattern", "setHeader", "setHeaders", "setProperty", "setVariable", "setVariables", "sort", "split", "step", "stop", "switch", "threads", "throttle", "throwException", "to", "toD", "tokenizer", "transacted", "transform", "transformDataType", "unmarshal", "validate", "wireTap" ], "deprecated": false, "autowired": false, "secret": false }
}
}
diff --git a/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/split.json b/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/split.json
index ca0c9e4909a8f..9ac5f17714ad1 100644
--- a/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/split.json
+++ b/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/split.json
@@ -37,7 +37,7 @@
"resumeStrategy": { "index": 21, "kind": "attribute", "displayName": "Resume Strategy", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.resume.ResumeStrategy", "deprecated": false, "autowired": false, "secret": false, "description": "Sets a ResumeStrategy for resume-from-last-position support. The watermark key must also be configured via watermarkKey(String) ." },
"watermarkKey": { "index": 22, "kind": "attribute", "displayName": "Watermark Key", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Sets the key to use in the watermark store." },
"watermarkExpression": { "index": 23, "kind": "attribute", "displayName": "Watermark Expression", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Sets a Simple expression to evaluate on each completed sub-exchange to determine the new watermark value. When set, enables value-based watermarking instead of index-based. The expression is evaluated using the Simple language." },
- "outputs": { "index": 24, "kind": "element", "displayName": "Outputs", "group": "common", "required": true, "type": "array", "javaType": "java.util.List>", "oneOf": [ "a2aSubTask", "aggregate", "bean", "cache", "choice", "circuitBreaker", "claimCheck", "convertBodyTo", "convertHeaderTo", "convertVariableTo", "delay", "doCatch", "doFinally", "doTry", "dynamicRouter", "enrich", "filter", "idempotentConsumer", "intercept", "interceptFrom", "interceptSendToEndpoint", "kamelet", "loadBalance", "log", "loop", "marshal", "multicast", "onCompletion", "onException", "pausable", "pipeline", "policy", "poll", "pollEnrich", "process", "recipientList", "removeHeader", "removeHeaders", "removeProperties", "removeProperty", "removeVariable", "resequence", "resumable", "rollback", "routingSlip", "saga", "sample", "script", "setBody", "setExchangePattern", "setHeader", "setHeaders", "setProperty", "setVariable", "setVariables", "sort", "split", "step", "stop", "threads", "throttle", "throwException", "to", "toD", "tokenizer", "transacted", "transform", "transformDataType", "unmarshal", "validate", "wireTap" ], "deprecated": false, "autowired": false, "secret": false }
+ "outputs": { "index": 24, "kind": "element", "displayName": "Outputs", "group": "common", "required": true, "type": "array", "javaType": "java.util.List>", "oneOf": [ "a2aSubTask", "aggregate", "bean", "cache", "choice", "circuitBreaker", "claimCheck", "convertBodyTo", "convertHeaderTo", "convertVariableTo", "delay", "doCatch", "doFinally", "doTry", "dynamicRouter", "enrich", "filter", "idempotentConsumer", "intercept", "interceptFrom", "interceptSendToEndpoint", "kamelet", "loadBalance", "log", "loop", "marshal", "multicast", "onCompletion", "onException", "pausable", "pipeline", "policy", "poll", "pollEnrich", "process", "recipientList", "removeHeader", "removeHeaders", "removeProperties", "removeProperty", "removeVariable", "resequence", "resumable", "rollback", "routingSlip", "saga", "sample", "script", "setBody", "setExchangePattern", "setHeader", "setHeaders", "setProperty", "setVariable", "setVariables", "sort", "split", "step", "stop", "switch", "threads", "throttle", "throwException", "to", "toD", "tokenizer", "transacted", "transform", "transformDataType", "unmarshal", "validate", "wireTap" ], "deprecated": false, "autowired": false, "secret": false }
},
"exchangeProperties": {
"CamelSplitIndex": { "index": 0, "kind": "exchangeProperty", "displayName": "Split Index", "label": "producer", "required": false, "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "important": true, "description": "A split counter that increases for each Exchange being split. The counter starts from 0." },
diff --git a/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/step.json b/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/step.json
index 4b05956cb882d..710b522ee3010 100644
--- a/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/step.json
+++ b/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/step.json
@@ -16,7 +16,7 @@
"note": { "index": 1, "kind": "attribute", "displayName": "Note", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The note for this node" },
"description": { "index": 2, "kind": "attribute", "displayName": "Description", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The description for this node" },
"disabled": { "index": 3, "kind": "attribute", "displayName": "Disabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether to disable this EIP from the route during build time. Once an EIP has been disabled then it cannot be enabled later at runtime." },
- "outputs": { "index": 4, "kind": "element", "displayName": "Outputs", "group": "common", "required": true, "type": "array", "javaType": "java.util.List", "oneOf": [ "a2aSubTask", "aggregate", "bean", "cache", "choice", "circuitBreaker", "claimCheck", "convertBodyTo", "convertHeaderTo", "convertVariableTo", "delay", "doCatch", "doFinally", "doTry", "dynamicRouter", "enrich", "filter", "idempotentConsumer", "intercept", "interceptFrom", "interceptSendToEndpoint", "kamelet", "loadBalance", "log", "loop", "marshal", "multicast", "onCompletion", "onException", "pausable", "pipeline", "policy", "poll", "pollEnrich", "process", "recipientList", "removeHeader", "removeHeaders", "removeProperties", "removeProperty", "removeVariable", "resequence", "resumable", "rollback", "routingSlip", "saga", "sample", "script", "setBody", "setExchangePattern", "setHeader", "setHeaders", "setProperty", "setVariable", "setVariables", "sort", "split", "step", "stop", "threads", "throttle", "throwException", "to", "toD", "tokenizer", "transacted", "transform", "transformDataType", "unmarshal", "validate", "wireTap" ], "deprecated": false, "autowired": false, "secret": false }
+ "outputs": { "index": 4, "kind": "element", "displayName": "Outputs", "group": "common", "required": true, "type": "array", "javaType": "java.util.List", "oneOf": [ "a2aSubTask", "aggregate", "bean", "cache", "choice", "circuitBreaker", "claimCheck", "convertBodyTo", "convertHeaderTo", "convertVariableTo", "delay", "doCatch", "doFinally", "doTry", "dynamicRouter", "enrich", "filter", "idempotentConsumer", "intercept", "interceptFrom", "interceptSendToEndpoint", "kamelet", "loadBalance", "log", "loop", "marshal", "multicast", "onCompletion", "onException", "pausable", "pipeline", "policy", "poll", "pollEnrich", "process", "recipientList", "removeHeader", "removeHeaders", "removeProperties", "removeProperty", "removeVariable", "resequence", "resumable", "rollback", "routingSlip", "saga", "sample", "script", "setBody", "setExchangePattern", "setHeader", "setHeaders", "setProperty", "setVariable", "setVariables", "sort", "split", "step", "stop", "switch", "threads", "throttle", "throwException", "to", "toD", "tokenizer", "transacted", "transform", "transformDataType", "unmarshal", "validate", "wireTap" ], "deprecated": false, "autowired": false, "secret": false }
},
"exchangeProperties": {
"CamelStepId": { "index": 0, "kind": "exchangeProperty", "displayName": "Step Id", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "autowired": false, "secret": false, "description": "The id of the Step EIP" }
diff --git a/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/switch.json b/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/switch.json
new file mode 100644
index 0000000000000..1da2d69acf5ba
--- /dev/null
+++ b/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/switch.json
@@ -0,0 +1,24 @@
+{
+ "model": {
+ "kind": "model",
+ "name": "switch",
+ "title": "Switch",
+ "description": "Evaluates a selector once and dispatches to a fixed endpoint by literal scalar values",
+ "deprecated": false,
+ "firstVersion": "4.23.0",
+ "label": "eip,routing",
+ "javaType": "org.apache.camel.model.SwitchDefinition",
+ "abstract": false,
+ "input": true,
+ "output": false
+ },
+ "properties": {
+ "id": { "index": 0, "kind": "attribute", "displayName": "Id", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The id of this node" },
+ "note": { "index": 1, "kind": "attribute", "displayName": "Note", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The note for this node" },
+ "description": { "index": 2, "kind": "attribute", "displayName": "Description", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The description for this node" },
+ "disabled": { "index": 3, "kind": "attribute", "displayName": "Disabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether to disable this EIP from the route during build time. Once an EIP has been disabled then it cannot be enabled later at runtime." },
+ "selector": { "index": 4, "kind": "expression", "displayName": "Selector", "group": "common", "required": true, "type": "object", "javaType": "org.apache.camel.model.ExpressionSubElementDefinition", "oneOf": [ "constant", "datasonnet", "exchangeProperty", "groovy", "header", "hl7terser", "jactl", "java", "jq", "js", "jsonpath", "language", "method", "mvel", "ognl", "python", "python3", "quickjs", "ref", "simple", "spel", "tokenize", "variable", "wasm", "xpath", "xquery", "xtokenize" ], "deprecated": false, "autowired": false, "secret": false, "description": "Expression evaluated once per entry. Returns a scalar value to match against the literal cases." },
+ "case": { "index": 5, "kind": "element", "displayName": "Case", "group": "common", "required": false, "type": "array", "javaType": "java.util.List", "deprecated": false, "autowired": false, "secret": false, "description": "Literal cases. Duplicate values are rejected at startup, ignoring case." },
+ "otherwise": { "index": 6, "kind": "element", "displayName": "Otherwise", "group": "common", "required": false, "type": "object", "javaType": "org.apache.camel.model.SwitchOtherwiseDefinition", "oneOf": [ "otherwise" ], "deprecated": false, "autowired": false, "secret": false, "description": "Fixed fallback URI for null or unmatched selector results. Without a fallback processing continues." }
+ }
+}
diff --git a/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/switchOtherwise.json b/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/switchOtherwise.json
new file mode 100644
index 0000000000000..ef34bee1569a8
--- /dev/null
+++ b/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/switchOtherwise.json
@@ -0,0 +1,17 @@
+{
+ "model": {
+ "kind": "model",
+ "name": "switchOtherwise",
+ "title": "Switch Otherwise",
+ "description": "The fixed endpoint used when no switch case matches",
+ "deprecated": false,
+ "label": "configuration",
+ "javaType": "org.apache.camel.model.SwitchOtherwiseDefinition",
+ "abstract": false,
+ "input": false,
+ "output": false
+ },
+ "properties": {
+ "uri": { "index": 0, "kind": "attribute", "displayName": "Uri", "group": "common", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The fixed destination URI. Supports property placeholders, but not Simple expressions." }
+ }
+}
diff --git a/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/when.json b/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/when.json
index e04a77617a656..44b0e97480e41 100644
--- a/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/when.json
+++ b/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/when.json
@@ -17,6 +17,6 @@
"description": { "index": 2, "kind": "attribute", "displayName": "Description", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The description for this node" },
"disabled": { "index": 3, "kind": "attribute", "displayName": "Disabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Disables this EIP from the route." },
"expression": { "index": 4, "kind": "expression", "displayName": "Expression", "group": "common", "required": true, "type": "object", "javaType": "org.apache.camel.model.language.ExpressionDefinition", "oneOf": [ "constant", "datasonnet", "exchangeProperty", "groovy", "header", "hl7terser", "jactl", "java", "jq", "js", "jsonpath", "language", "method", "mvel", "ognl", "python", "python3", "quickjs", "ref", "simple", "spel", "tokenize", "variable", "wasm", "xpath", "xquery", "xtokenize" ], "deprecated": false, "autowired": false, "secret": false, "asPredicate": true, "description": "Expression used as the predicate to evaluate whether this when should trigger and route the message or not." },
- "outputs": { "index": 5, "kind": "element", "displayName": "Outputs", "group": "common", "required": true, "type": "array", "javaType": "java.util.List>", "oneOf": [ "a2aSubTask", "aggregate", "bean", "cache", "choice", "circuitBreaker", "claimCheck", "convertBodyTo", "convertHeaderTo", "convertVariableTo", "delay", "doCatch", "doFinally", "doTry", "dynamicRouter", "enrich", "filter", "idempotentConsumer", "intercept", "interceptFrom", "interceptSendToEndpoint", "kamelet", "loadBalance", "log", "loop", "marshal", "multicast", "onCompletion", "onException", "pausable", "pipeline", "policy", "poll", "pollEnrich", "process", "recipientList", "removeHeader", "removeHeaders", "removeProperties", "removeProperty", "removeVariable", "resequence", "resumable", "rollback", "routingSlip", "saga", "sample", "script", "setBody", "setExchangePattern", "setHeader", "setHeaders", "setProperty", "setVariable", "setVariables", "sort", "split", "step", "stop", "threads", "throttle", "throwException", "to", "toD", "tokenizer", "transacted", "transform", "transformDataType", "unmarshal", "validate", "wireTap" ], "deprecated": false, "autowired": false, "secret": false }
+ "outputs": { "index": 5, "kind": "element", "displayName": "Outputs", "group": "common", "required": true, "type": "array", "javaType": "java.util.List>", "oneOf": [ "a2aSubTask", "aggregate", "bean", "cache", "choice", "circuitBreaker", "claimCheck", "convertBodyTo", "convertHeaderTo", "convertVariableTo", "delay", "doCatch", "doFinally", "doTry", "dynamicRouter", "enrich", "filter", "idempotentConsumer", "intercept", "interceptFrom", "interceptSendToEndpoint", "kamelet", "loadBalance", "log", "loop", "marshal", "multicast", "onCompletion", "onException", "pausable", "pipeline", "policy", "poll", "pollEnrich", "process", "recipientList", "removeHeader", "removeHeaders", "removeProperties", "removeProperty", "removeVariable", "resequence", "resumable", "rollback", "routingSlip", "saga", "sample", "script", "setBody", "setExchangePattern", "setHeader", "setHeaders", "setProperty", "setVariable", "setVariables", "sort", "split", "step", "stop", "switch", "threads", "throttle", "throwException", "to", "toD", "tokenizer", "transacted", "transform", "transformDataType", "unmarshal", "validate", "wireTap" ], "deprecated": false, "autowired": false, "secret": false }
}
}
diff --git a/core/camel-core-model/src/generated/resources/META-INF/services/org/apache/camel/model.properties b/core/camel-core-model/src/generated/resources/META-INF/services/org/apache/camel/model.properties
index e56e3291c84dc..b03878ae40e5f 100644
--- a/core/camel-core-model/src/generated/resources/META-INF/services/org/apache/camel/model.properties
+++ b/core/camel-core-model/src/generated/resources/META-INF/services/org/apache/camel/model.properties
@@ -14,6 +14,7 @@ beanio
bearerToken
bindy
cache
+case
cbor
choice
circuitBreaker
@@ -197,6 +198,8 @@ stop
streamConfig
swiftMt
swiftMx
+switch
+switchOtherwise
syslog
tarFile
templateParameter
diff --git a/core/camel-core-model/src/generated/resources/org/apache/camel/model/jaxb.index b/core/camel-core-model/src/generated/resources/org/apache/camel/model/jaxb.index
index c74b9dece4f1a..24edfb49a2ddb 100644
--- a/core/camel-core-model/src/generated/resources/org/apache/camel/model/jaxb.index
+++ b/core/camel-core-model/src/generated/resources/org/apache/camel/model/jaxb.index
@@ -97,6 +97,9 @@ SortDefinition
SplitDefinition
StepDefinition
StopDefinition
+SwitchCaseDefinition
+SwitchDefinition
+SwitchOtherwiseDefinition
TemplatedRouteDefinition
TemplatedRouteParameterDefinition
TemplatedRoutesDefinition
diff --git a/core/camel-core-model/src/main/java/org/apache/camel/model/ProcessorDefinition.java b/core/camel-core-model/src/main/java/org/apache/camel/model/ProcessorDefinition.java
index d3c8cb78b2961..d1fd12db95c61 100644
--- a/core/camel-core-model/src/main/java/org/apache/camel/model/ProcessorDefinition.java
+++ b/core/camel-core-model/src/main/java/org/apache/camel/model/ProcessorDefinition.java
@@ -1639,6 +1639,31 @@ public ChoiceDefinition choice() {
return answer;
}
+ /**
+ * Routes to a fixed endpoint using a literal selector lookup.
+ *
+ * @param selector the expression to evaluate once per entry
+ * @return the switch builder
+ */
+ public SwitchDefinition doSwitch(Expression selector) {
+ SwitchDefinition answer = new SwitchDefinition(selector);
+ addOutput(answer);
+ return answer;
+ }
+
+ /**
+ * Routes to a fixed endpoint using a literal selector lookup.
+ *
+ * @return the selector expression builder
+ */
+ public ExpressionClause doSwitch() {
+ SwitchDefinition answer = new SwitchDefinition();
+ ExpressionClause clause = new ExpressionClause<>(answer);
+ answer.setSelector(new ExpressionSubElementDefinition((Expression) clause));
+ addOutput(answer);
+ return clause;
+ }
+
/**
* Creates a try/catch block
*
diff --git a/core/camel-core-model/src/main/java/org/apache/camel/model/SwitchCaseDefinition.java b/core/camel-core-model/src/main/java/org/apache/camel/model/SwitchCaseDefinition.java
new file mode 100644
index 0000000000000..fbbabe0c98456
--- /dev/null
+++ b/core/camel-core-model/src/main/java/org/apache/camel/model/SwitchCaseDefinition.java
@@ -0,0 +1,130 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.model;
+
+import jakarta.xml.bind.annotation.XmlAccessType;
+import jakarta.xml.bind.annotation.XmlAccessorType;
+import jakarta.xml.bind.annotation.XmlAttribute;
+import jakarta.xml.bind.annotation.XmlRootElement;
+import jakarta.xml.bind.annotation.XmlTransient;
+
+import org.apache.camel.spi.Metadata;
+
+/** One literal value and one fixed destination. */
+@Metadata(label = "configuration", description = "A literal switch case with one fixed endpoint destination")
+@XmlRootElement(name = "case")
+@XmlAccessorType(XmlAccessType.FIELD)
+public class SwitchCaseDefinition extends OptionalIdentifiedDefinition
+ implements EndpointRequiredDefinition {
+ @XmlAttribute(required = true)
+ @Metadata(description = "The case-insensitive literal value for a scalar selector.")
+ private String value;
+ @XmlAttribute(required = true)
+ @Metadata(description = "The fixed destination URI. Supports property placeholders, but not Simple expressions.")
+ private String uri;
+ @XmlTransient
+ private SwitchDefinition parent;
+ @XmlTransient
+ private ToDefinition toDefinition;
+
+ public SwitchCaseDefinition() {
+ }
+
+ public SwitchCaseDefinition(String value, String uri) {
+ this.value = value;
+ this.uri = uri;
+ }
+
+ protected SwitchCaseDefinition(SwitchCaseDefinition source) {
+ super(source);
+ this.value = source.value;
+ this.uri = source.uri;
+ }
+
+ public SwitchCaseDefinition copyDefinition() {
+ return new SwitchCaseDefinition(this);
+ }
+
+ public String getValue() {
+ return value;
+ }
+
+ public void setValue(String value) {
+ this.value = value;
+ }
+
+ public String getUri() {
+ return uri;
+ }
+
+ public void setUri(String uri) {
+ this.uri = uri;
+ }
+
+ /** The destination node shared by reification and management instrumentation. */
+ @XmlTransient
+ public ToDefinition getToDefinition() {
+ return toDefinition;
+ }
+
+ /** Prepare the destination node before processor creation and management instrumentation. */
+ public void prepareToDefinition() {
+ if (toDefinition == null) {
+ toDefinition = new ToDefinition();
+ }
+ toDefinition.setUri(uri);
+ toDefinition.setParent(parent);
+ if (hasCustomIdAssigned()) {
+ toDefinition.setId(getId());
+ } else {
+ toDefinition.setGeneratedId(getId());
+ }
+ toDefinition.setDescription(getDescription());
+ toDefinition.setNote(getNote());
+ toDefinition.setLocation(getLocation());
+ toDefinition.setLineNumber(getLineNumber());
+ }
+
+ @Override
+ public String getEndpointUri() {
+ return uri;
+ }
+
+ @Override
+ public SwitchDefinition getParent() {
+ return parent;
+ }
+
+ public void setParent(SwitchDefinition parent) {
+ this.parent = parent;
+ }
+
+ @Override
+ public String getShortName() {
+ return "case";
+ }
+
+ @Override
+ public String getLabel() {
+ return "case[" + value + "]";
+ }
+
+ @Override
+ public String toString() {
+ return getLabel() + " -> " + uri;
+ }
+}
diff --git a/core/camel-core-model/src/main/java/org/apache/camel/model/SwitchDefinition.java b/core/camel-core-model/src/main/java/org/apache/camel/model/SwitchDefinition.java
new file mode 100644
index 0000000000000..944d6e059e50b
--- /dev/null
+++ b/core/camel-core-model/src/main/java/org/apache/camel/model/SwitchDefinition.java
@@ -0,0 +1,233 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.model;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import jakarta.xml.bind.annotation.XmlAccessType;
+import jakarta.xml.bind.annotation.XmlAccessorType;
+import jakarta.xml.bind.annotation.XmlElement;
+import jakarta.xml.bind.annotation.XmlRootElement;
+import jakarta.xml.bind.annotation.XmlTransient;
+import jakarta.xml.bind.annotation.XmlType;
+
+import org.apache.camel.Expression;
+import org.apache.camel.NamedNode;
+import org.apache.camel.builder.ExpressionClause;
+import org.apache.camel.model.language.ExpressionDefinition;
+import org.apache.camel.spi.Metadata;
+
+/** Routes a message to one fixed endpoint using a literal lookup table. */
+@Metadata(firstVersion = "4.23.0", label = "eip,routing",
+ description = "Evaluates a selector once and dispatches to a fixed endpoint by literal scalar values")
+@XmlRootElement(name = "switch")
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(propOrder = { "selector", "cases", "otherwise" })
+public class SwitchDefinition extends NoOutputDefinition {
+ @XmlElement(required = true)
+ @Metadata(required = true,
+ description = "Expression evaluated once per entry. Returns a scalar value to match against the literal cases.")
+ private ExpressionSubElementDefinition selector;
+ @XmlElement(name = "case")
+ @Metadata(description = "Literal cases. Duplicate values are rejected at startup, ignoring case.")
+ private List cases = new ArrayList<>();
+ @XmlElement
+ @Metadata(description = "Fixed fallback URI for null or unmatched selector results. Without a fallback processing continues.")
+ private SwitchOtherwiseDefinition otherwise;
+
+ public SwitchDefinition() {
+ }
+
+ public SwitchDefinition(Expression selector) {
+ this.selector = new ExpressionSubElementDefinition(ExpressionNodeHelper.toExpressionDefinition(selector));
+ }
+
+ protected SwitchDefinition(SwitchDefinition source) {
+ super(source);
+ this.selector = source.selector != null ? source.selector.copyDefinition() : null;
+ setOtherwise(source.otherwise != null ? source.otherwise.copyDefinition() : null);
+ for (SwitchCaseDefinition c : source.cases) {
+ SwitchCaseDefinition copy = c.copyDefinition();
+ copy.setParent(this);
+ cases.add(copy);
+ }
+ }
+
+ @Override
+ public SwitchDefinition copyDefinition() {
+ return new SwitchDefinition(this);
+ }
+
+ public ExpressionSubElementDefinition getSelector() {
+ return selector;
+ }
+
+ @Override
+ public void preCreateProcessor() {
+ if (selector != null && selector.getExpressionType() != null
+ && selector.getExpressionType().getExpressionValue() instanceof ExpressionClause> clause
+ && clause.getExpressionType() instanceof ExpressionDefinition expression) {
+ selector.setExpressionType(expression);
+ }
+ }
+
+ public void setSelector(ExpressionSubElementDefinition selector) {
+ this.selector = selector;
+ }
+
+ public List getCases() {
+ return cases;
+ }
+
+ public void setCases(List cases) {
+ this.cases = cases;
+ }
+
+ public SwitchOtherwiseDefinition getOtherwise() {
+ return otherwise;
+ }
+
+ public void setOtherwise(SwitchOtherwiseDefinition otherwise) {
+ this.otherwise = otherwise;
+ prepareOtherwiseDefinition();
+ }
+
+ @Override
+ public void setId(String id) {
+ super.setId(id);
+ prepareOtherwiseDefinition();
+ }
+
+ @Override
+ public void setGeneratedId(String id) {
+ super.setGeneratedId(id);
+ prepareOtherwiseDefinition();
+ }
+
+ /** The fallback send node, used by route traversal and processor creation. */
+ @XmlTransient
+ public ToDefinition getOtherwiseDefinition() {
+ return otherwise != null ? otherwise.getToDefinition() : null;
+ }
+
+ /** Prepare the fallback node before processor creation and management instrumentation. */
+ public void prepareOtherwiseDefinition() {
+ ToDefinition otherwiseDefinition = getOtherwiseDefinition();
+ if (otherwiseDefinition == null) {
+ return;
+ }
+ otherwiseDefinition.setParent(this);
+ otherwiseDefinition.setUri(otherwise.getUri());
+ if (getId() != null) {
+ if (hasCustomIdAssigned()) {
+ otherwiseDefinition.setId(getId() + "-otherwise");
+ } else {
+ otherwiseDefinition.setGeneratedId(getId() + "-otherwise");
+ }
+ }
+ }
+
+ /** Add a scalar literal and its destination. */
+ public SwitchDefinition doCase(String value, String uri) {
+ return doCase(new SwitchCaseDefinition(value, uri));
+ }
+
+ /** Add a case definition. */
+ public SwitchDefinition doCase(SwitchCaseDefinition value) {
+ value.setParent(this);
+ cases.add(value);
+ if (getCamelContext() != null && (getCamelContext().isSourceLocationEnabled()
+ || getCamelContext().isDebugging() || getCamelContext().isDebugStandby()
+ || getCamelContext().isTracing() || getCamelContext().isTracingStandby())) {
+ ProcessorDefinitionHelper.prepareSourceLocation(ProcessorDefinitionHelper.getResource(this), value);
+ }
+ return this;
+ }
+
+ /** Build a scalar case. */
+ public CaseBuilder doCase(String value) {
+ return new CaseBuilder(this, new SwitchCaseDefinition(value, null));
+ }
+
+ /** Set the fixed fallback destination. */
+ public SwitchDefinition otherwise(String uri) {
+ SwitchOtherwiseDefinition fallback = null;
+ if (uri != null) {
+ fallback = new SwitchOtherwiseDefinition();
+ fallback.setUri(uri);
+ }
+ setOtherwise(fallback);
+ return this;
+ }
+
+ @Override
+ public List getChildren() {
+ List children = new ArrayList<>(cases);
+ ToDefinition fallback = getOtherwiseDefinition();
+ if (fallback != null) {
+ children.add(fallback);
+ }
+ return children;
+ }
+
+ @Override
+ public String getShortName() {
+ return "switch";
+ }
+
+ @Override
+ public String getLabel() {
+ return "switch[" + selector + "]";
+ }
+
+ @Override
+ public String toString() {
+ return getLabel() + cases;
+ }
+
+ /** A case builder that permits exactly one endpoint and no nested route steps. */
+ public static final class CaseBuilder {
+ private final SwitchDefinition parent;
+ private final SwitchCaseDefinition definition;
+
+ private CaseBuilder(SwitchDefinition parent, SwitchCaseDefinition definition) {
+ this.parent = parent;
+ this.definition = definition;
+ }
+
+ public CaseBuilder id(String id) {
+ definition.setId(id);
+ return this;
+ }
+
+ public CaseBuilder description(String description) {
+ definition.setDescription(description);
+ return this;
+ }
+
+ public CaseBuilder note(String note) {
+ definition.setNote(note);
+ return this;
+ }
+
+ public SwitchDefinition to(String uri) {
+ definition.setUri(uri);
+ return parent.doCase(definition);
+ }
+ }
+}
diff --git a/core/camel-core-model/src/main/java/org/apache/camel/model/SwitchOtherwiseDefinition.java b/core/camel-core-model/src/main/java/org/apache/camel/model/SwitchOtherwiseDefinition.java
new file mode 100644
index 0000000000000..d5cd511b20895
--- /dev/null
+++ b/core/camel-core-model/src/main/java/org/apache/camel/model/SwitchOtherwiseDefinition.java
@@ -0,0 +1,73 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.model;
+
+import jakarta.xml.bind.Unmarshaller;
+import jakarta.xml.bind.annotation.XmlAccessType;
+import jakarta.xml.bind.annotation.XmlAccessorType;
+import jakarta.xml.bind.annotation.XmlAttribute;
+import jakarta.xml.bind.annotation.XmlRootElement;
+import jakarta.xml.bind.annotation.XmlTransient;
+
+import org.apache.camel.spi.Metadata;
+
+/** The fixed fallback destination of a switch. */
+@Metadata(label = "configuration", description = "The fixed endpoint used when no switch case matches")
+@XmlRootElement(name = "switchOtherwise")
+@XmlAccessorType(XmlAccessType.FIELD)
+public class SwitchOtherwiseDefinition implements EndpointRequiredDefinition {
+ @XmlAttribute(required = true)
+ @Metadata(description = "The fixed destination URI. Supports property placeholders, but not Simple expressions.")
+ private String uri;
+ @XmlTransient
+ private final ToDefinition toDefinition = new ToDefinition();
+
+ public SwitchOtherwiseDefinition copyDefinition() {
+ SwitchOtherwiseDefinition copy = new SwitchOtherwiseDefinition();
+ copy.setUri(uri);
+ return copy;
+ }
+
+ public String getUri() {
+ return uri;
+ }
+
+ public void setUri(String uri) {
+ this.uri = uri;
+ toDefinition.setUri(uri);
+ }
+
+ /** The destination node, available for endpoint discovery before route startup. */
+ @XmlTransient
+ public ToDefinition getToDefinition() {
+ return toDefinition;
+ }
+
+ // JAXB populates fields directly, so initialize the traversal node after loading.
+ private void afterUnmarshal(Unmarshaller unmarshaller, Object parent) {
+ toDefinition.setUri(uri);
+ if (parent instanceof SwitchDefinition sw) {
+ sw.setOtherwise(this);
+ }
+ }
+
+ @Override
+ @XmlTransient
+ public String getEndpointUri() {
+ return uri;
+ }
+}
diff --git a/core/camel-core-model/src/test/java/org/apache/camel/model/SwitchDefinitionTest.java b/core/camel-core-model/src/test/java/org/apache/camel/model/SwitchDefinitionTest.java
new file mode 100644
index 0000000000000..715e1a31075dd
--- /dev/null
+++ b/core/camel-core-model/src/test/java/org/apache/camel/model/SwitchDefinitionTest.java
@@ -0,0 +1,67 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.model;
+
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotSame;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertSame;
+
+class SwitchDefinitionTest {
+ @Test
+ void readingDestinationsDoesNotOverwritePreparedNodes() {
+ SwitchDefinition sw = new SwitchDefinition().id("dispatch")
+ .doCase("billing", "{{case.uri}}").otherwise("{{fallback.uri}}");
+ SwitchCaseDefinition c = sw.getCases().get(0);
+ c.setId("billing");
+ assertNull(c.getToDefinition());
+ sw.getChildren();
+ assertNull(c.getToDefinition());
+
+ c.prepareToDefinition();
+ sw.prepareOtherwiseDefinition();
+ ToDefinition caseSend = c.getToDefinition();
+ ToDefinition fallbackSend = sw.getOtherwiseDefinition();
+ caseSend.setUri("mock:billing");
+ caseSend.setId("prepared-billing");
+ fallbackSend.setUri("mock:review");
+ fallbackSend.setId("prepared-fallback");
+
+ assertSame(caseSend, c.getToDefinition());
+ assertSame(fallbackSend, sw.getOtherwiseDefinition());
+ assertSame(fallbackSend, sw.getChildren().get(1));
+ assertEquals("mock:billing", caseSend.getUri());
+ assertEquals("prepared-billing", caseSend.getId());
+ assertEquals("mock:review", fallbackSend.getUri());
+ assertEquals("prepared-fallback", fallbackSend.getId());
+ }
+
+ @Test
+ void copiedFallbackHasIndependentDestinationAndParent() {
+ SwitchDefinition original = new SwitchDefinition().otherwise("mock:original");
+ SwitchDefinition copy = original.copyDefinition();
+ copy.getOtherwise().setUri("mock:copy");
+
+ assertNotSame(original.getOtherwiseDefinition(), copy.getOtherwiseDefinition());
+ assertSame(original, original.getOtherwiseDefinition().getParent());
+ assertSame(copy, copy.getOtherwiseDefinition().getParent());
+ assertEquals("mock:original", original.getOtherwiseDefinition().getUri());
+ assertEquals("mock:copy", copy.getOtherwiseDefinition().getUri());
+ }
+}
diff --git a/core/camel-core-processor/src/main/java/org/apache/camel/processor/SwitchProcessor.java b/core/camel-core-processor/src/main/java/org/apache/camel/processor/SwitchProcessor.java
new file mode 100644
index 0000000000000..064d33f0ddb7c
--- /dev/null
+++ b/core/camel-core-processor/src/main/java/org/apache/camel/processor/SwitchProcessor.java
@@ -0,0 +1,197 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.processor;
+
+import java.util.ArrayList;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+import java.util.concurrent.atomic.AtomicLongArray;
+
+import org.apache.camel.AsyncCallback;
+import org.apache.camel.AsyncProcessor;
+import org.apache.camel.CamelContext;
+import org.apache.camel.Exchange;
+import org.apache.camel.Expression;
+import org.apache.camel.Navigate;
+import org.apache.camel.Processor;
+import org.apache.camel.Traceable;
+import org.apache.camel.spi.IdAware;
+import org.apache.camel.spi.RouteIdAware;
+import org.apache.camel.spi.StepIdAware;
+import org.apache.camel.support.AsyncProcessorConverterHelper;
+import org.apache.camel.support.MessageHelper;
+import org.apache.camel.support.service.ServiceHelper;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import static org.apache.camel.processor.PipelineHelper.continueProcessing;
+
+/** Evaluates one selector and dispatches through a table of literal keys. */
+public class SwitchProcessor extends BaseProcessorSupport
+ implements Navigate, Traceable, IdAware, RouteIdAware, StepIdAware {
+ private static final Logger LOG = LoggerFactory.getLogger(SwitchProcessor.class);
+ private final CamelContext context;
+ private final Expression selector;
+ private final Map table = new LinkedHashMap<>();
+ private final List processors = new ArrayList<>();
+ private final AsyncProcessor otherwise;
+ private final AtomicLongArray counts;
+ private String id;
+ private String routeId;
+ private String stepId;
+
+ public SwitchProcessor(CamelContext context, Expression selector,
+ Map cases, Processor otherwise) {
+ this.context = context;
+ this.selector = selector;
+ cases.forEach((key, processor) -> {
+ table.put(key, processors.size());
+ processors.add(AsyncProcessorConverterHelper.convert(processor));
+ });
+ this.otherwise = otherwise == null ? null : AsyncProcessorConverterHelper.convert(otherwise);
+ counts = new AtomicLongArray(processors.size() + 1);
+ }
+
+ @Override
+ public boolean process(Exchange exchange, AsyncCallback callback) {
+ String key = null;
+ try {
+ Object result = selector.evaluate(exchange, Object.class);
+ if (result != null) {
+ if (result instanceof Map, ?>) {
+ throw new IllegalArgumentException(
+ "Switch requires a scalar selector result, but received a Map. Composite selector results are not supported.");
+ }
+ if (result instanceof Iterable> || result.getClass().isArray()) {
+ throw new IllegalArgumentException(
+ "Switch requires a scalar selector result, but received a collection or array");
+ }
+ String text = context.getTypeConverter().mandatoryConvertTo(String.class, exchange, result);
+ key = text.toLowerCase(Locale.ENGLISH);
+ }
+ } catch (Exception e) {
+ exchange.setException(e);
+ } finally {
+ MessageHelper.resetStreamCache(exchange.getIn());
+ }
+ if (!continueProcessing(exchange, "so breaking out of switch", LOG)) {
+ callback.done(true);
+ return true;
+ }
+ Integer index = key == null ? null : table.get(key);
+ if (index != null) {
+ counts.incrementAndGet(index);
+ return processors.get(index).process(exchange, callback);
+ }
+ counts.incrementAndGet(processors.size());
+ if (otherwise != null) {
+ return otherwise.process(exchange, callback);
+ }
+ callback.done(true);
+ return true;
+ }
+
+ public long getMatchedCount(int index) {
+ return counts.get(index);
+ }
+
+ public long getUnmatchedCount() {
+ return counts.get(processors.size());
+ }
+
+ public void reset() {
+ for (int i = 0; i < counts.length(); i++) {
+ counts.set(i, 0);
+ }
+ }
+
+ @Override
+ public List next() {
+ List answer = new ArrayList<>(processors);
+ if (otherwise != null) {
+ answer.add(otherwise);
+ }
+ return answer;
+ }
+
+ @Override
+ public boolean hasNext() {
+ return !processors.isEmpty() || otherwise != null;
+ }
+
+ @Override
+ public String getTraceLabel() {
+ return "switch";
+ }
+
+ @Override
+ public String toString() {
+ return id;
+ }
+
+ @Override
+ public String getId() {
+ return id;
+ }
+
+ @Override
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ @Override
+ public String getRouteId() {
+ return routeId;
+ }
+
+ @Override
+ public void setRouteId(String routeId) {
+ this.routeId = routeId;
+ }
+
+ @Override
+ public String getStepId() {
+ return stepId;
+ }
+
+ @Override
+ public void setStepId(String stepId) {
+ this.stepId = stepId;
+ }
+
+ @Override
+ protected void doInit() throws Exception {
+ ServiceHelper.initService(processors, otherwise);
+ }
+
+ @Override
+ protected void doStart() throws Exception {
+ ServiceHelper.startService(processors, otherwise);
+ }
+
+ @Override
+ protected void doStop() throws Exception {
+ ServiceHelper.stopService(otherwise, processors);
+ }
+
+ @Override
+ protected void doShutdown() throws Exception {
+ ServiceHelper.stopAndShutdownServices(otherwise, processors);
+ }
+}
diff --git a/core/camel-core-reifier/src/main/java/org/apache/camel/reifier/ProcessorReifier.java b/core/camel-core-reifier/src/main/java/org/apache/camel/reifier/ProcessorReifier.java
index 45396721e88e9..cd149d697471a 100644
--- a/core/camel-core-reifier/src/main/java/org/apache/camel/reifier/ProcessorReifier.java
+++ b/core/camel-core-reifier/src/main/java/org/apache/camel/reifier/ProcessorReifier.java
@@ -101,6 +101,7 @@
import org.apache.camel.model.SplitDefinition;
import org.apache.camel.model.StepDefinition;
import org.apache.camel.model.StopDefinition;
+import org.apache.camel.model.SwitchDefinition;
import org.apache.camel.model.ThreadsDefinition;
import org.apache.camel.model.ThrottleDefinition;
import org.apache.camel.model.ThrowExceptionDefinition;
@@ -217,6 +218,8 @@ public static ProcessorReifier extends ProcessorDefinition>> coreReifier(
return new CacheReifier(route, definition);
} else if (definition instanceof CatchDefinition) {
return new CatchReifier(route, definition);
+ } else if (definition instanceof SwitchDefinition) {
+ return new SwitchReifier(route, definition);
} else if (definition instanceof ChoiceDefinition) {
return new ChoiceReifier(route, definition);
} else if (definition instanceof CircuitBreakerDefinition) {
diff --git a/core/camel-core-reifier/src/main/java/org/apache/camel/reifier/SwitchReifier.java b/core/camel-core-reifier/src/main/java/org/apache/camel/reifier/SwitchReifier.java
new file mode 100644
index 0000000000000..77adf6751f4cc
--- /dev/null
+++ b/core/camel-core-reifier/src/main/java/org/apache/camel/reifier/SwitchReifier.java
@@ -0,0 +1,107 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.reifier;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+
+import org.apache.camel.Expression;
+import org.apache.camel.Processor;
+import org.apache.camel.Route;
+import org.apache.camel.model.ProcessorDefinition;
+import org.apache.camel.model.SwitchCaseDefinition;
+import org.apache.camel.model.SwitchDefinition;
+import org.apache.camel.model.ToDefinition;
+import org.apache.camel.processor.SwitchProcessor;
+import org.apache.camel.spi.NodeIdFactory;
+
+public class SwitchReifier extends ProcessorReifier {
+ public SwitchReifier(Route route, ProcessorDefinition> definition) {
+ super(route, (SwitchDefinition) definition);
+ }
+
+ @Override
+ public Processor createProcessor() throws Exception {
+ definition.preCreateProcessor();
+ if (definition.getSelector() == null || definition.getSelector().getExpressionType() == null) {
+ throw new IllegalArgumentException("Switch selector requires an expression");
+ }
+ // Validate the complete table before creating endpoint processors.
+ List caseKeys = new ArrayList<>();
+ List uris = new ArrayList<>();
+ for (SwitchCaseDefinition c : definition.getCases()) {
+ if (c.getValue() == null) {
+ throw new IllegalArgumentException("Switch cases require value");
+ }
+ String key = c.getValue().toLowerCase(Locale.ENGLISH);
+ caseKeys.add(key);
+ uris.add(staticUri(c.getUri()));
+ }
+ if (new HashSet<>(caseKeys).size() != caseKeys.size()) {
+ throw new IllegalArgumentException("Duplicate switch case after literal normalization");
+ }
+ String otherwiseUri = definition.getOtherwise() == null ? null : staticUri(definition.getOtherwise().getUri());
+ Expression selector = createExpression(definition.getSelector().getExpressionType());
+ NodeIdFactory ids = camelContext.getCamelContextExtension().getContextPlugin(NodeIdFactory.class);
+ Map cases = new LinkedHashMap<>();
+ for (int i = 0; i < definition.getCases().size(); i++) {
+ SwitchCaseDefinition c = definition.getCases().get(i);
+ c.setParent(definition);
+ c.setCamelContext(camelContext);
+ c.idOrCreate(ids);
+ c.prepareToDefinition();
+ ToDefinition send = c.getToDefinition();
+ send.setUri(uris.get(i));
+ cases.put(caseKeys.get(i), createSend(send));
+ }
+ Processor otherwise = null;
+ if (otherwiseUri != null) {
+ definition.idOrCreate(ids);
+ definition.prepareOtherwiseDefinition();
+ ToDefinition send = definition.getOtherwiseDefinition();
+ send.setUri(otherwiseUri);
+ otherwise = createSend(send);
+ }
+ SwitchProcessor answer = new SwitchProcessor(camelContext, selector, cases, otherwise);
+ answer.setDisabled(isDisabled(camelContext, definition));
+ return answer;
+ }
+
+ private Processor createSend(ToDefinition send) throws Exception {
+ send.setParent(definition);
+ send.setCamelContext(camelContext);
+ return createOutputsProcessor(List.of(send));
+ }
+
+ private String staticUri(String uri) {
+ if (uri == null || uri.isBlank()) {
+ throw new IllegalArgumentException("Switch case requires a nonblank uri");
+ }
+ String resolved = parseString(uri);
+ if (resolved == null || resolved.isBlank()) {
+ throw new IllegalArgumentException("Switch URI must resolve to a nonblank destination");
+ }
+ if (resolved.contains("${") || resolved.contains("$simple{")) {
+ throw new IllegalArgumentException("Switch URI must be static; Simple expressions are not supported");
+ }
+ return resolved;
+ }
+}
diff --git a/core/camel-core/src/test/java/org/apache/camel/processor/SwitchEndpointTest.java b/core/camel-core/src/test/java/org/apache/camel/processor/SwitchEndpointTest.java
new file mode 100644
index 0000000000000..eaf5952a4da7d
--- /dev/null
+++ b/core/camel-core/src/test/java/org/apache/camel/processor/SwitchEndpointTest.java
@@ -0,0 +1,109 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.processor;
+
+import java.util.Properties;
+import java.util.concurrent.atomic.AtomicInteger;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.ContextTestSupport;
+import org.apache.camel.Exchange;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.model.RouteDefinition;
+import org.apache.camel.model.RouteDefinitionHelper;
+import org.apache.camel.model.language.HeaderExpression;
+import org.apache.camel.support.ExpressionAdapter;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+class SwitchEndpointTest extends ContextTestSupport {
+ private final AtomicInteger initializations = new AtomicInteger();
+ private final AtomicInteger evaluations = new AtomicInteger();
+ private final AtomicInteger attempts = new AtomicInteger();
+
+ @Test
+ void routeEndpointDiscoveryIncludesCaseAndFallback() {
+ RouteDefinition route = new RouteDefinition("direct:discovery");
+ var sw = route.doSwitch(new HeaderExpression("decision")).doCase("match", "mock:destination")
+ .otherwise("mock:fallback");
+ var uris = RouteDefinitionHelper.gatherAllStaticEndpointUris(context, route, false, true);
+ assertTrue(uris.contains("mock://destination"), uris.toString());
+ assertTrue(uris.contains("mock://fallback"), uris.toString());
+ sw.getOtherwise().setUri("mock:updated");
+ uris = RouteDefinitionHelper.gatherAllStaticEndpointUris(context, route, false, true);
+ assertTrue(uris.contains("mock://updated"), uris.toString());
+ assertFalse(uris.contains("mock://fallback"), uris.toString());
+ }
+
+ @Test
+ void resolvedDestinationsUseInterceptorsAndRestartWithTheRoute() throws Exception {
+ getMockEndpoint("mock:intercepted").expectedMessageCount(2);
+ getMockEndpoint("mock:destination").expectedBodiesReceived("first", "second");
+ template.sendBody("direct:intercepted", "first");
+ context.getRouteController().stopRoute("intercepted");
+ context.getRouteController().startRoute("intercepted");
+ template.sendBody("direct:intercepted", "second");
+ assertMockEndpointsSatisfied();
+ }
+
+ @Test
+ void selectedEndpointRedeliveryDoesNotRepeatSelector() throws Exception {
+ getMockEndpoint("mock:delivered").expectedBodiesReceived("message");
+ template.sendBody("direct:redelivery", "message");
+ assertMockEndpointsSatisfied();
+ assertEquals(1, evaluations.get());
+ assertEquals(1, initializations.get());
+ assertEquals(2, attempts.get());
+ }
+
+ @Override
+ protected RouteBuilder createRouteBuilder() {
+ Properties properties = new Properties();
+ properties.setProperty("switch.destination", "mock:destination");
+ context.getPropertiesComponent().setInitialProperties(properties);
+ return new RouteBuilder() {
+ @Override
+ public void configure() {
+ interceptSendToEndpoint("mock:destination").to("mock:intercepted");
+ from("direct:intercepted").routeId("intercepted").doSwitch(constant("match"))
+ .doCase("match", "{{switch.destination}}").otherwise("mock:fallback");
+ from("direct:redelivery")
+ .errorHandler(defaultErrorHandler().maximumRedeliveries(1).redeliveryDelay(0))
+ .doSwitch(new ExpressionAdapter() {
+ @Override
+ public void init(CamelContext context) {
+ initializations.incrementAndGet();
+ }
+
+ @Override
+ public Object evaluate(Exchange exchange) {
+ evaluations.incrementAndGet();
+ return "match";
+ }
+ }).doCase("match", "direct:destination");
+ from("direct:destination").errorHandler(noErrorHandler()).process(exchange -> {
+ if (attempts.incrementAndGet() == 1) {
+ throw new IllegalStateException("retry destination");
+ }
+ }).to("mock:delivered");
+ }
+ };
+ }
+}
diff --git a/core/camel-core/src/test/java/org/apache/camel/processor/SwitchTest.java b/core/camel-core/src/test/java/org/apache/camel/processor/SwitchTest.java
new file mode 100644
index 0000000000000..1abc11b399544
--- /dev/null
+++ b/core/camel-core/src/test/java/org/apache/camel/processor/SwitchTest.java
@@ -0,0 +1,191 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.processor;
+
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
+import java.nio.charset.StandardCharsets;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+import java.util.concurrent.atomic.AtomicInteger;
+
+import org.apache.camel.ContextTestSupport;
+import org.apache.camel.Exchange;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.support.ExpressionAdapter;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertInstanceOf;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+class SwitchTest extends ContextTestSupport {
+ private final AtomicInteger evaluations = new AtomicInteger();
+
+ @Test
+ void scalarMatchingAndFallback() throws Exception {
+ getMockEndpoint("mock:billing").expectedMessageCount(2);
+ getMockEndpoint("mock:empty").expectedMessageCount(1);
+ getMockEndpoint("mock:literal").expectedMessageCount(1);
+ getMockEndpoint("mock:otherwiseLiteral").expectedMessageCount(1);
+ getMockEndpoint("mock:review").expectedMessageCount(3);
+ getMockEndpoint("mock:after").expectedMessageCount(8);
+ for (String value : new String[] { "billing", "BILLING", "", "billing*", "billing123", "other", "OTHERWISE" }) {
+ template.sendBodyAndHeader("direct:scalar", "message", "department", value);
+ }
+ template.sendBody("direct:scalar", "message");
+ assertMockEndpointsSatisfied();
+ }
+
+ @Test
+ void structuredSelectorResultsFailWithoutUsingFallback() throws Exception {
+ getMockEndpoint("mock:review").expectedMessageCount(0);
+ getMockEndpoint("mock:after").expectedMessageCount(0);
+ for (Object result : new Object[] {
+ Map.of("department", "billing", "urgent", true),
+ List.of("billing"), new String[] { "billing" } }) {
+ Exchange answer = template.request("direct:scalar", e -> e.getIn().setHeader("department", result));
+ IllegalArgumentException failure = assertInstanceOf(IllegalArgumentException.class, answer.getException());
+ assertTrue(failure.getMessage().contains("Switch requires a scalar selector result"));
+ if (result instanceof Map, ?>) {
+ assertTrue(failure.getMessage().contains("Composite selector results are not supported"));
+ }
+ }
+ assertMockEndpointsSatisfied();
+ }
+
+ @Test
+ void mapSelectorResultFollowsErrorHandling() throws Exception {
+ getMockEndpoint("mock:error").expectedMessageCount(1);
+ getMockEndpoint("mock:review").expectedMessageCount(0);
+ getMockEndpoint("mock:after").expectedMessageCount(0);
+ Exchange answer = template.request("direct:map", e -> e.getIn().setBody("message"));
+ assertNull(answer.getException());
+ assertInstanceOf(IllegalArgumentException.class, answer.getProperty(Exchange.EXCEPTION_CAUGHT));
+ assertMockEndpointsSatisfied();
+ }
+
+ @Test
+ void noFallbackContinues() throws Exception {
+ getMockEndpoint("mock:after").expectedMessageCount(2);
+ template.sendBodyAndHeader("direct:noFallback", "other", "department", "other");
+ template.sendBody("direct:noFallback", "null");
+ assertMockEndpointsSatisfied();
+ }
+
+ @Test
+ void repeatedEntryEvaluatesOncePerEntry() throws Exception {
+ getMockEndpoint("mock:one").expectedMessageCount(1);
+ getMockEndpoint("mock:two").expectedMessageCount(1);
+ getMockEndpoint("mock:three").expectedMessageCount(1);
+ template.sendBody("direct:loop", "message");
+ assertEquals(3, evaluations.get());
+ assertMockEndpointsSatisfied();
+ }
+
+ @Test
+ void nestedSwitchesSelectIndependently() throws Exception {
+ getMockEndpoint("mock:urgent").expectedMessageCount(1);
+ getMockEndpoint("mock:after").expectedMessageCount(1);
+ template.sendBodyAndHeaders("direct:nested", "message",
+ Map.of("department", "billing", "decision", "urgent"));
+ assertMockEndpointsSatisfied();
+ }
+
+ @Test
+ void selectorExceptionFollowsErrorHandling() throws Exception {
+ getMockEndpoint("mock:error").expectedMessageCount(1);
+ getMockEndpoint("mock:review").expectedMessageCount(0);
+ getMockEndpoint("mock:after").expectedMessageCount(0);
+ Exchange answer = template.request("direct:failure", e -> e.getIn().setBody("message"));
+ assertNull(answer.getException());
+ assertTrue(answer.getProperty(Exchange.EXCEPTION_CAUGHT) instanceof IllegalStateException);
+ assertMockEndpointsSatisfied();
+ }
+
+ @Test
+ void selectorRewindsStreamForDestination() throws Exception {
+ getMockEndpoint("mock:stream").expectedBodiesReceived("hello");
+ template.sendBody("direct:stream", new ByteArrayInputStream("hello".getBytes(StandardCharsets.UTF_8)));
+ assertMockEndpointsSatisfied();
+ }
+
+ @Test
+ void normalizationDoesNotDependOnDefaultLocale() throws Exception {
+ Locale original = Locale.getDefault();
+ try {
+ Locale.setDefault(Locale.forLanguageTag("tr-TR"));
+ getMockEndpoint("mock:billing").expectedMessageCount(1);
+ template.sendBodyAndHeader("direct:scalar", "message", "department", "BILLING");
+ assertMockEndpointsSatisfied();
+ } finally {
+ Locale.setDefault(original);
+ }
+ }
+
+ @Override
+ protected RouteBuilder createRouteBuilder() {
+ return new RouteBuilder() {
+ @Override
+ public void configure() {
+ from("direct:scalar").doSwitch().header("department")
+ .doCase("billing", "mock:billing").doCase("", "mock:empty").doCase("billing*", "mock:literal")
+ .doCase("otherwise", "mock:otherwiseLiteral")
+ .otherwise("mock:review").end().to("mock:after");
+ from("direct:noFallback").doSwitch(header("department")).doCase("billing", "mock:billing")
+ .end().to("mock:after");
+ from("direct:loop").loop(3).doSwitch(new ExpressionAdapter() {
+ @Override
+ public Object evaluate(Exchange exchange) {
+ return evaluations.incrementAndGet();
+ }
+ }).doCase("1", "mock:one").doCase("2", "mock:two").doCase("3", "mock:three").end().end();
+ from("direct:nested").choice().when(header("department").isEqualTo("billing"))
+ .doSwitch(header("department")).doCase("billing", "direct:priority")
+ .end().end().to("mock:after");
+ from("direct:priority").doSwitch(header("decision")).doCase("urgent", "mock:urgent");
+ from("direct:map").onException(IllegalArgumentException.class).handled(true).to("mock:error").end()
+ .doSwitch(new ExpressionAdapter() {
+ @Override
+ public Object evaluate(Exchange exchange) {
+ return Map.of("department", "billing", "urgent", true);
+ }
+ }).otherwise("mock:review").end().to("mock:after");
+ from("direct:failure").onException(IllegalStateException.class).handled(true).to("mock:error").end()
+ .doSwitch(new ExpressionAdapter() {
+ @Override
+ public Object evaluate(Exchange exchange) { throw new IllegalStateException("selector failed");
+ }
+ }).otherwise("mock:review").end().to("mock:after");
+ from("direct:stream").streamCaching().doSwitch(new ExpressionAdapter() {
+ @Override
+ public Object evaluate(Exchange exchange) {
+ try {
+ exchange.getIn().getBody(InputStream.class).readAllBytes();
+ return "read";
+ } catch (Exception e) {
+ throw new IllegalStateException(e);
+ }
+ }
+ }).doCase("read", "direct:readStream");
+ from("direct:readStream").convertBodyTo(String.class).to("mock:stream");
+ }
+ };
+ }
+}
diff --git a/core/camel-core/src/test/java/org/apache/camel/processor/SwitchValidationTest.java b/core/camel-core/src/test/java/org/apache/camel/processor/SwitchValidationTest.java
new file mode 100644
index 0000000000000..7c6eca2798dd1
--- /dev/null
+++ b/core/camel-core/src/test/java/org/apache/camel/processor/SwitchValidationTest.java
@@ -0,0 +1,100 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.processor;
+
+import java.util.function.Consumer;
+
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.impl.DefaultCamelContext;
+import org.apache.camel.model.ExpressionSubElementDefinition;
+import org.apache.camel.model.SwitchDefinition;
+import org.apache.camel.model.SwitchOtherwiseDefinition;
+import org.apache.camel.model.language.HeaderExpression;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertThrows;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+class SwitchValidationTest {
+ @Test
+ void rejectsCaseIdCollidingWithFallback() {
+ rejects(s -> s.id("dispatch").doCase("billing").id("dispatch-otherwise").to("mock:a").otherwise("mock:b"),
+ "Duplicate id detected");
+ }
+
+ @Test
+ void rejectsDuplicateScalarValues() {
+ rejects(s -> s.doCase("Billing", "mock:a").doCase("billing", "mock:b"), "Duplicate switch case");
+ }
+
+ @Test
+ void rejectsMissingUri() {
+ rejects(s -> s.doCase("billing", null), "nonblank uri");
+ }
+
+ @Test
+ void rejectsMissingFallbackUri() {
+ rejects(s -> s.setOtherwise(new SwitchOtherwiseDefinition()), "nonblank uri");
+ }
+
+ @Test
+ void rejectsDynamicFallbackUri() {
+ rejects(s -> s.otherwise("mock:${header.target}"), "must be static");
+ }
+
+ @Test
+ void rejectsDynamicUri() {
+ rejects(s -> s.doCase("billing", "mock:${header.target}"), "must be static");
+ }
+
+ @Test
+ void rejectsMissingValue() {
+ rejects(s -> s.doCase(null, "mock:a"), "require value");
+ }
+
+ @Test
+ void rejectsMissingSelector() {
+ rejects(s -> s.setSelector(null), "selector requires an expression");
+ }
+
+ @Test
+ void rejectsEmptySelector() {
+ rejects(s -> s.setSelector(new ExpressionSubElementDefinition()), "selector requires an expression");
+ }
+
+ private void rejects(Consumer configure, String message) {
+ Exception failure = assertThrows(Exception.class, () -> {
+ try (DefaultCamelContext context = new DefaultCamelContext()) {
+ context.addRoutes(new RouteBuilder() {
+ @Override
+ public void configure() {
+ SwitchDefinition s = new SwitchDefinition();
+ s.setSelector(new ExpressionSubElementDefinition(new HeaderExpression("decision")));
+ configure.accept(s);
+ from("direct:start").addOutput(s);
+ }
+ });
+ context.start();
+ }
+ });
+ StringBuilder chain = new StringBuilder();
+ for (Throwable cause = failure; cause != null; cause = cause.getCause()) {
+ chain.append(cause.getMessage()).append('\n');
+ }
+ assertTrue(chain.toString().contains(message), chain.toString());
+ }
+}
diff --git a/core/camel-java-io/src/generated/java/org/apache/camel/java/out/JavaDslModelWriter.java b/core/camel-java-io/src/generated/java/org/apache/camel/java/out/JavaDslModelWriter.java
index 6bd836608b24d..df5d2c563441e 100644
--- a/core/camel-java-io/src/generated/java/org/apache/camel/java/out/JavaDslModelWriter.java
+++ b/core/camel-java-io/src/generated/java/org/apache/camel/java/out/JavaDslModelWriter.java
@@ -663,6 +663,26 @@ public String writeStopDefinition(StopDefinition def) {
doWriteStopDefinition(sb, def);
return sb.toString();
}
+ public String writeSwitchCaseDefinition(SwitchCaseDefinition def) {
+ resetState();
+ StringBuilder sb = new StringBuilder();
+ beginStep(sb, "case", def);
+ doWriteSwitchCaseDefinition(sb, def);
+ return sb.toString();
+ }
+ public String writeSwitchDefinition(SwitchDefinition def) {
+ resetState();
+ StringBuilder sb = new StringBuilder();
+ writeSwitch(sb, def);
+ return sb.toString();
+ }
+ public String writeSwitchOtherwiseDefinition(SwitchOtherwiseDefinition def) {
+ resetState();
+ StringBuilder sb = new StringBuilder();
+ beginStep(sb, "switchOtherwise", def);
+ doWriteSwitchOtherwiseDefinition(sb, def);
+ return sb.toString();
+ }
public String writeTemplatedRouteDefinition(TemplatedRouteDefinition def) {
resetState();
StringBuilder sb = new StringBuilder();
@@ -2576,6 +2596,20 @@ protected void doWriteStepDefinition(StringBuilder sb, StepDefinition def) {
protected void doWriteStopDefinition(StringBuilder sb, StopDefinition def) {
doWriteProcessorDefinitionAttributes(sb, def);
}
+ protected void doWriteSwitchCaseDefinition(StringBuilder sb, SwitchCaseDefinition def) {
+ doWriteOptionalIdentifiedDefinitionAttributes(sb, def);
+ doWriteAttribute(sb, "value", def.getValue(), null);
+ doWriteAttribute(sb, "uri", def.getUri(), null);
+ }
+ protected void doWriteSwitchDefinition(StringBuilder sb, SwitchDefinition def) {
+ doWriteProcessorDefinitionAttributes(sb, def);
+ doWriteChildElement(sb, "selector", def.getSelector(), this::doWriteExpressionSubElementDefinition);
+ doWriteChildList(sb, "case", def.getCases(), this::doWriteSwitchCaseDefinition);
+ doWriteChildElement(sb, "otherwise", def.getOtherwise(), this::doWriteSwitchOtherwiseDefinition);
+ }
+ protected void doWriteSwitchOtherwiseDefinition(StringBuilder sb, SwitchOtherwiseDefinition def) {
+ doWriteAttribute(sb, "uri", def.getUri(), null);
+ }
protected void doWriteTemplatedRouteDefinition(StringBuilder sb, TemplatedRouteDefinition def) {
doWriteAttribute(sb, "routeTemplateRef", def.getRouteTemplateRef(), null);
doWriteAttribute(sb, "routeId", def.getRouteId(), null);
@@ -4885,6 +4919,12 @@ protected void doWriteOptionalIdentifiedDefinitionRef(StringBuilder sb, Optional
doWriteStopDefinition(sb, (StopDefinition) v);
endStep(sb, "stop", v);
}
+ case "SwitchCaseDefinition" -> {
+ beginStep(sb, "case", v);
+ doWriteSwitchCaseDefinition(sb, (SwitchCaseDefinition) v);
+ endStep(sb, "case", v);
+ }
+ case "SwitchDefinition" -> writeSwitch(sb, (SwitchDefinition) v);
case "TemplatedRoutesDefinition" -> {
beginStep(sb, "templatedRoutes", v);
doWriteTemplatedRoutesDefinition(sb, (TemplatedRoutesDefinition) v);
@@ -5977,6 +6017,7 @@ protected void doWriteProcessorDefinitionRef(StringBuilder sb, ProcessorDefiniti
doWriteStopDefinition(sb, (StopDefinition) v);
endStep(sb, "stop", v);
}
+ case "SwitchDefinition" -> writeSwitch(sb, (SwitchDefinition) v);
case "ThreadsDefinition" -> {
ThreadsDefinition _d = (ThreadsDefinition) v;
handledAttributes.clear();
diff --git a/core/camel-java-io/src/main/java/org/apache/camel/java/out/JavaDslModelWriterSupport.java b/core/camel-java-io/src/main/java/org/apache/camel/java/out/JavaDslModelWriterSupport.java
index f54e1dcd2aa5b..afbffa2a0cb28 100644
--- a/core/camel-java-io/src/main/java/org/apache/camel/java/out/JavaDslModelWriterSupport.java
+++ b/core/camel-java-io/src/main/java/org/apache/camel/java/out/JavaDslModelWriterSupport.java
@@ -32,6 +32,7 @@
import org.apache.camel.model.InterceptSendToEndpointDefinition;
import org.apache.camel.model.LoadBalancerDefinition;
import org.apache.camel.model.OnWhenDefinition;
+import org.apache.camel.model.OptionalIdentifiedDefinition;
import org.apache.camel.model.ProcessorDefinition;
import org.apache.camel.model.PropertyDefinition;
import org.apache.camel.model.PropertyExpressionDefinition;
@@ -39,6 +40,8 @@
import org.apache.camel.model.RouteDefinition;
import org.apache.camel.model.RouteTemplateDefinition;
import org.apache.camel.model.RouteTemplateParameterDefinition;
+import org.apache.camel.model.SwitchCaseDefinition;
+import org.apache.camel.model.SwitchDefinition;
import org.apache.camel.model.TemplatedRouteDefinition;
import org.apache.camel.model.TemplatedRouteParameterDefinition;
import org.apache.camel.model.ToDefinition;
@@ -87,6 +90,31 @@
*/
public abstract class JavaDslModelWriterSupport {
+ protected void writeSwitch(StringBuilder sb, SwitchDefinition definition) {
+ definition.preCreateProcessor();
+ handledAttributes.clear();
+ sb.append(NL).append(indent()).append(".doSwitch(")
+ .append(expressionDsl(definition.getSelector().getExpressionType())).append(")");
+ doWriteProcessorDefinitionAttributes(sb, definition);
+ for (SwitchCaseDefinition c : definition.getCases()) {
+ sb.append(NL).append(indent()).append(".doCase(");
+ sb.append(quote(c.getValue()));
+ sb.append(")");
+ handledAttributes.clear();
+ doWriteOptionalIdentifiedDefinitionAttributes(sb, c);
+ sb.append(".to(").append(quote(c.getUri())).append(")");
+ }
+ if (definition.getOtherwise() != null) {
+ sb.append(NL).append(indent()).append(".otherwise(").append(quote(definition.getOtherwise().getUri())).append(")");
+ }
+ sb.append(NL).append(indent()).append(".end()");
+ }
+
+ protected abstract void doWriteProcessorDefinitionAttributes(StringBuilder sb, ProcessorDefinition> definition);
+
+ protected abstract void doWriteOptionalIdentifiedDefinitionAttributes(
+ StringBuilder sb, OptionalIdentifiedDefinition> definition);
+
private static final String NL = "\n";
private static final Set BLOCK_EIPS = Set.of(
diff --git a/core/camel-java-io/src/test/java/org/apache/camel/java/out/JavaDslModelWriterTest.java b/core/camel-java-io/src/test/java/org/apache/camel/java/out/JavaDslModelWriterTest.java
index 618831f97cb69..4db0f71425721 100644
--- a/core/camel-java-io/src/test/java/org/apache/camel/java/out/JavaDslModelWriterTest.java
+++ b/core/camel-java-io/src/test/java/org/apache/camel/java/out/JavaDslModelWriterTest.java
@@ -32,6 +32,7 @@
import org.apache.camel.model.SetHeaderDefinition;
import org.apache.camel.model.SetVariableDefinition;
import org.apache.camel.model.SplitDefinition;
+import org.apache.camel.model.SwitchDefinition;
import org.apache.camel.model.ToDefinition;
import org.apache.camel.model.ToDynamicDefinition;
import org.apache.camel.model.TransformDefinition;
@@ -46,6 +47,27 @@
public class JavaDslModelWriterTest {
+ @Test
+ void switchExportPreservesDisabledAndCaseMetadata() {
+ SwitchDefinition sw = new RouteDefinition().doSwitch().header("decision");
+ sw.id("dispatch").disabled(true).description("Table dispatch").note("dispatch note");
+ sw.doCase("billing").id("billingCase").description("Billing destination").note("case note").to("mock:billing");
+ sw.otherwise("mock:review");
+ JavaDslModelWriter writer = new JavaDslModelWriter();
+ String java = writer.writeSwitchDefinition(sw);
+ Assertions.assertTrue(java.contains(".doSwitch(header(\"decision\"))"), java);
+ Assertions.assertTrue(java.contains(".disabled(\"true\")"), java);
+ Assertions.assertTrue(java.contains(".id(\"dispatch\")"), java);
+ Assertions.assertTrue(java.contains(".description(\"Table dispatch\")"), java);
+ Assertions.assertTrue(java.contains(".id(\"billingCase\")"), java);
+ Assertions.assertTrue(java.contains(".note(\"case note\")"), java);
+ Assertions.assertTrue(java.contains(".otherwise(\"mock:review\")"), java);
+ sw.setCustomId(false);
+ sw.getCases().get(0).setCustomId(false);
+ java = writer.writeSwitchDefinition(sw);
+ Assertions.assertFalse(java.contains(".id("), java);
+ }
+
private String loadExpected(String name) throws IOException {
return Files.readString(Paths.get("src/test/resources/" + name));
}
diff --git a/core/camel-java-io/src/test/resources/switchLiteral.xml b/core/camel-java-io/src/test/resources/switchLiteral.xml
new file mode 100644
index 0000000000000..ec3bd1fe70c6d
--- /dev/null
+++ b/core/camel-java-io/src/test/resources/switchLiteral.xml
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/core/camel-management-api/src/main/java/org/apache/camel/api/management/mbean/CamelOpenMBeanTypes.java b/core/camel-management-api/src/main/java/org/apache/camel/api/management/mbean/CamelOpenMBeanTypes.java
index 5d5a652490259..248b3ba2f1153 100644
--- a/core/camel-management-api/src/main/java/org/apache/camel/api/management/mbean/CamelOpenMBeanTypes.java
+++ b/core/camel-management-api/src/main/java/org/apache/camel/api/management/mbean/CamelOpenMBeanTypes.java
@@ -205,6 +205,19 @@ public static CompositeType choiceCompositeType() throws OpenDataException {
new OpenType[] { SimpleType.INTEGER, SimpleType.STRING, SimpleType.STRING, SimpleType.LONG });
}
+ public static TabularType switchTabularType() throws OpenDataException {
+ return new TabularType("switch", "Switch statistics", switchCompositeType(), new String[] { "index" });
+ }
+
+ public static CompositeType switchCompositeType() throws OpenDataException {
+ return new CompositeType(
+ "cases", "Switch cases",
+ new String[] { "index", "id", "value", "uri", "matches" },
+ new String[] { "Index", "Case id", "Literal values", "Destination", "Selections" },
+ new OpenType[] {
+ SimpleType.INTEGER, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.LONG });
+ }
+
public static TabularType doTryTabularType() throws OpenDataException {
CompositeType ct = doTryCompositeType();
return new TabularType("doTry", "doTry statistics", ct, new String[] { "index" });
diff --git a/core/camel-management-api/src/main/java/org/apache/camel/api/management/mbean/ManagedSwitchMBean.java b/core/camel-management-api/src/main/java/org/apache/camel/api/management/mbean/ManagedSwitchMBean.java
new file mode 100644
index 0000000000000..a0689efc790cf
--- /dev/null
+++ b/core/camel-management-api/src/main/java/org/apache/camel/api/management/mbean/ManagedSwitchMBean.java
@@ -0,0 +1,31 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.api.management.mbean;
+
+import javax.management.openmbean.TabularData;
+
+import org.apache.camel.api.management.ManagedAttribute;
+import org.apache.camel.api.management.ManagedOperation;
+
+public interface ManagedSwitchMBean extends ManagedProcessorMBean, ManagedExtendedInformation {
+ @Override
+ @ManagedOperation(description = "Literal switch cases, destinations and selection counts")
+ TabularData extendedInformation();
+
+ @ManagedAttribute(description = "Number of null or unmatched selector results")
+ long getUnmatchedCount();
+}
diff --git a/core/camel-management/src/main/java/org/apache/camel/management/DefaultManagementObjectStrategy.java b/core/camel-management/src/main/java/org/apache/camel/management/DefaultManagementObjectStrategy.java
index c5beb08537e5a..d5dd85ab0fe17 100644
--- a/core/camel-management/src/main/java/org/apache/camel/management/DefaultManagementObjectStrategy.java
+++ b/core/camel-management/src/main/java/org/apache/camel/management/DefaultManagementObjectStrategy.java
@@ -103,6 +103,7 @@
import org.apache.camel.management.mbean.ManagedStop;
import org.apache.camel.management.mbean.ManagedSupervisingRouteController;
import org.apache.camel.management.mbean.ManagedSuspendableRoute;
+import org.apache.camel.management.mbean.ManagedSwitch;
import org.apache.camel.management.mbean.ManagedThreadPool;
import org.apache.camel.management.mbean.ManagedThreads;
import org.apache.camel.management.mbean.ManagedThrottler;
@@ -160,6 +161,7 @@
import org.apache.camel.processor.StepProcessor;
import org.apache.camel.processor.StopProcessor;
import org.apache.camel.processor.StreamResequencer;
+import org.apache.camel.processor.SwitchProcessor;
import org.apache.camel.processor.ThreadsProcessor;
import org.apache.camel.processor.Throttler;
import org.apache.camel.processor.ThrowExceptionProcessor;
@@ -366,6 +368,8 @@ public Object getManagedObjectForProcessor(
answer = new ManagedConvertHeader(context, chp, definition);
} else if (target instanceof ConvertVariableProcessor cvp) {
answer = new ManagedConvertVariable(context, cvp, definition);
+ } else if (target instanceof SwitchProcessor sp) {
+ answer = new ManagedSwitch(context, sp, definition);
} else if (target instanceof ChoiceProcessor cp) {
answer = new ManagedChoice(context, cp, definition);
} else if (target instanceof ClaimCheckProcessor ccp) {
diff --git a/core/camel-management/src/main/java/org/apache/camel/management/JmxManagementLifecycleStrategy.java b/core/camel-management/src/main/java/org/apache/camel/management/JmxManagementLifecycleStrategy.java
index 8f39265ef7868..fb4243c97a3cd 100644
--- a/core/camel-management/src/main/java/org/apache/camel/management/JmxManagementLifecycleStrategy.java
+++ b/core/camel-management/src/main/java/org/apache/camel/management/JmxManagementLifecycleStrategy.java
@@ -90,6 +90,7 @@
import org.apache.camel.model.ProcessorDefinition;
import org.apache.camel.model.ProcessorDefinitionHelper;
import org.apache.camel.model.RouteDefinition;
+import org.apache.camel.model.SwitchDefinition;
import org.apache.camel.spi.AsyncProcessorAwaitManager;
import org.apache.camel.spi.BeanIntrospection;
import org.apache.camel.spi.BrowsableVariableRepository;
@@ -966,6 +967,18 @@ private void registerPerformanceCounters(
registerPerformanceCounters(route, child, registeredCounters);
}
+ // Switch destinations are literal sends rather than nested processor outputs.
+ if (processor instanceof SwitchDefinition sw) {
+ for (var c : sw.getCases()) {
+ c.prepareToDefinition();
+ registerPerformanceCounters(route, c.getToDefinition(), registeredCounters);
+ }
+ sw.prepareOtherwiseDefinition();
+ if (sw.getOtherwiseDefinition() != null) {
+ registerPerformanceCounters(route, sw.getOtherwiseDefinition(), registeredCounters);
+ }
+ }
+
// skip processors that should not be registered
if (!registerProcessor(processor)) {
return;
diff --git a/core/camel-management/src/main/java/org/apache/camel/management/mbean/ManagedSwitch.java b/core/camel-management/src/main/java/org/apache/camel/management/mbean/ManagedSwitch.java
new file mode 100644
index 0000000000000..f16205dc31a4b
--- /dev/null
+++ b/core/camel-management/src/main/java/org/apache/camel/management/mbean/ManagedSwitch.java
@@ -0,0 +1,100 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.management.mbean;
+
+import javax.management.openmbean.CompositeDataSupport;
+import javax.management.openmbean.TabularData;
+import javax.management.openmbean.TabularDataSupport;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.RuntimeCamelException;
+import org.apache.camel.api.management.ManagedResource;
+import org.apache.camel.api.management.mbean.CamelOpenMBeanTypes;
+import org.apache.camel.api.management.mbean.ManagedSwitchMBean;
+import org.apache.camel.model.ProcessorDefinition;
+import org.apache.camel.model.SwitchCaseDefinition;
+import org.apache.camel.model.SwitchDefinition;
+import org.apache.camel.processor.SwitchProcessor;
+import org.apache.camel.spi.ManagementStrategy;
+import org.apache.camel.util.URISupport;
+
+@ManagedResource(description = "Managed Switch")
+public class ManagedSwitch extends ManagedProcessor implements ManagedSwitchMBean {
+ private boolean mask;
+
+ public ManagedSwitch(CamelContext context, SwitchProcessor processor, ProcessorDefinition> definition) {
+ super(context, processor, definition);
+ }
+
+ @Override
+ public void init(ManagementStrategy strategy) {
+ super.init(strategy);
+ mask = strategy.getManagementAgent().getMask() != null ? strategy.getManagementAgent().getMask() : true;
+ }
+
+ @Override
+ public SwitchProcessor getProcessor() {
+ return (SwitchProcessor) super.getProcessor();
+ }
+
+ @Override
+ public SwitchDefinition getDefinition() {
+ return (SwitchDefinition) super.getDefinition();
+ }
+
+ @Override
+ public Boolean getSupportExtendedInformation() {
+ return true;
+ }
+
+ @Override
+ public long getUnmatchedCount() {
+ return getProcessor().getUnmatchedCount();
+ }
+
+ @Override
+ public void reset() {
+ getProcessor().reset();
+ super.reset();
+ }
+
+ @Override
+ public TabularData extendedInformation() {
+ try {
+ TabularDataSupport table = new TabularDataSupport(CamelOpenMBeanTypes.switchTabularType());
+ for (int i = 0; i < getDefinition().getCases().size(); i++) {
+ SwitchCaseDefinition c = getDefinition().getCases().get(i);
+ addRow(table, c.getId(), c.getValue(),
+ c.getUri(), getProcessor().getMatchedCount(i));
+ }
+ if (getDefinition().getOtherwise() != null) {
+ addRow(table, getDefinition().getId() + "-otherwise", "otherwise", getDefinition().getOtherwise().getUri(),
+ getUnmatchedCount());
+ }
+ return table;
+ } catch (Exception e) {
+ throw RuntimeCamelException.wrapRuntimeCamelException(e);
+ }
+ }
+
+ private void addRow(TabularDataSupport table, String id, String value, String uri, long matches) throws Exception {
+ table.put(new CompositeDataSupport(
+ CamelOpenMBeanTypes.switchCompositeType(),
+ new String[] { "index", "id", "value", "uri", "matches" },
+ new Object[] { table.size(), id, value, mask ? URISupport.sanitizeUri(uri) : uri, matches }));
+ }
+}
diff --git a/core/camel-management/src/test/java/org/apache/camel/management/ManagedSwitchTest.java b/core/camel-management/src/test/java/org/apache/camel/management/ManagedSwitchTest.java
new file mode 100644
index 0000000000000..d8f6520adfe0f
--- /dev/null
+++ b/core/camel-management/src/test/java/org/apache/camel/management/ManagedSwitchTest.java
@@ -0,0 +1,101 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.management;
+
+import javax.management.ObjectName;
+import javax.management.openmbean.TabularData;
+
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.processor.SendProcessor;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.condition.DisabledOnOs;
+import org.junit.jupiter.api.condition.OS;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.NullSource;
+import org.junit.jupiter.params.provider.ValueSource;
+
+import static org.apache.camel.management.DefaultManagementObjectNameStrategy.TYPE_PROCESSOR;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+@DisabledOnOs(OS.AIX)
+class ManagedSwitchTest extends ManagementTestSupport {
+ @Test
+ void exposesCaseDestinationsCountsAndCaseMBeans() throws Exception {
+ template.sendBodyAndHeader("direct:start", "first", "decision", "BILLING");
+ template.sendBodyAndHeader("direct:start", "second", "decision", "billing");
+ template.sendBody("direct:start", "unmatched");
+ ObjectName name = getCamelObjectName(TYPE_PROCESSOR, "p-dispatch");
+ TabularData table = (TabularData) getMBeanServer().invoke(name, "extendedInformation", null, null);
+ assertEquals(2, table.size());
+ var first = table.get(new Object[] { 0 });
+ assertEquals("urgentCase", first.get("id"));
+ assertEquals("mock:urgent", first.get("uri"));
+ assertEquals(2L, first.get("matches"));
+ assertEquals(1L, table.get(new Object[] { 1 }).get("matches"));
+ assertEquals("mock:review", table.get(new Object[] { 1 }).get("uri"));
+ assertTrue(getMBeanServer().isRegistered(getCamelObjectName(TYPE_PROCESSOR, "p-urgentCase")),
+ getMBeanServer().queryNames(new ObjectName("org.apache.camel:type=processors,*"), null).toString());
+ assertTrue(getMBeanServer().isRegistered(getCamelObjectName(TYPE_PROCESSOR, "p-dispatch-otherwise")));
+ assertNotNull(context.getProcessor("p-urgentCase", SendProcessor.class));
+ assertNotNull(context.getProcessor("p-dispatch-otherwise", SendProcessor.class));
+ getMBeanServer().invoke(name, "reset", null, null);
+ table = (TabularData) getMBeanServer().invoke(name, "extendedInformation", null, null);
+ assertEquals(0L, table.get(new Object[] { 0 }).get("matches"));
+ assertEquals(0L, getMBeanServer().getAttribute(name, "UnmatchedCount"));
+ }
+
+ @ParameterizedTest
+ @NullSource
+ @ValueSource(booleans = { true, false })
+ void masksCaseAndFallbackUris(Boolean mask) throws Exception {
+ // A null parameter exercises the agent's default without overriding it.
+ if (mask != null) {
+ context.getManagementStrategy().getManagementAgent().setMask(mask);
+ }
+ context.addRoutes(new RouteBuilder() {
+ @Override
+ public void configure() {
+ from("direct:masked").nodePrefixId("p-")
+ .doSwitch(header("decision")).id("masked")
+ .doCase("billing", "mock:billing?password=caseSecret")
+ .otherwise("mock:review?password=fallbackSecret");
+ }
+ });
+ TabularData table = (TabularData) getMBeanServer().invoke(
+ getCamelObjectName(TYPE_PROCESSOR, "p-masked"), "extendedInformation", null, null);
+ boolean sanitized = !Boolean.FALSE.equals(mask);
+ assertEquals("mock:billing?password=" + (sanitized ? "xxxxxx" : "caseSecret"),
+ table.get(new Object[] { 0 }).get("uri"));
+ assertEquals("mock:review?password=" + (sanitized ? "xxxxxx" : "fallbackSecret"),
+ table.get(new Object[] { 1 }).get("uri"));
+ }
+
+ @Override
+ protected RouteBuilder createRouteBuilder() {
+ return new RouteBuilder() {
+ @Override
+ public void configure() {
+ from("direct:start").routeId("switchRoute").nodePrefixId("p-")
+ .doSwitch(header("decision")).id("dispatch")
+ .doCase("billing").id("urgentCase").to("mock:urgent")
+ .otherwise("mock:review");
+ }
+ };
+ }
+}
diff --git a/core/camel-xml-io/src/generated/java/org/apache/camel/xml/in/ModelParser.java b/core/camel-xml-io/src/generated/java/org/apache/camel/xml/in/ModelParser.java
index 10f7d4edf7366..bc3bfa23bd4d8 100644
--- a/core/camel-xml-io/src/generated/java/org/apache/camel/xml/in/ModelParser.java
+++ b/core/camel-xml-io/src/generated/java/org/apache/camel/xml/in/ModelParser.java
@@ -1181,6 +1181,27 @@ protected StepDefinition doParseStepDefinition() throws IOException, XmlPullPars
protected StopDefinition doParseStopDefinition() throws IOException, XmlPullParserException {
return doParse(new StopDefinition(), processorDefinitionAttributeHandler(), optionalIdentifiedDefinitionElementHandler(), noValueHandler());
}
+ protected SwitchCaseDefinition doParseSwitchCaseDefinition() throws IOException, XmlPullParserException {
+ return doParse(new SwitchCaseDefinition(), (def, key, val) -> switch (key) {
+ case "uri": def.setUri(sanitizeUri(val)); yield true;
+ case "value": def.setValue(val); yield true;
+ default: yield optionalIdentifiedDefinitionAttributeHandler().accept(def, key, val);
+ }, optionalIdentifiedDefinitionElementHandler(), noValueHandler());
+ }
+ protected SwitchDefinition doParseSwitchDefinition() throws IOException, XmlPullParserException {
+ return doParse(new SwitchDefinition(), processorDefinitionAttributeHandler(), (def, key) -> switch (key) {
+ case "case": doAdd(doParseSwitchCaseDefinition(), def.getCases(), def::setCases); yield true;
+ case "otherwise": def.setOtherwise(doParseSwitchOtherwiseDefinition()); yield true;
+ case "selector": def.setSelector(doParseExpressionSubElementDefinition()); yield true;
+ default: yield optionalIdentifiedDefinitionElementHandler().accept(def, key);
+ }, noValueHandler());
+ }
+ protected SwitchOtherwiseDefinition doParseSwitchOtherwiseDefinition() throws IOException, XmlPullParserException {
+ return doParse(new SwitchOtherwiseDefinition(), (def, key, val) -> switch (key) {
+ case "uri": def.setUri(sanitizeUri(val)); yield true;
+ default: yield false;
+ }, noElementHandler(), noValueHandler());
+ }
protected TemplatedRouteDefinition doParseTemplatedRouteDefinition() throws IOException, XmlPullParserException {
return doParse(new TemplatedRouteDefinition(), (def, key, val) -> switch (key) {
case "group": def.setGroup(val); yield true;
@@ -2836,6 +2857,7 @@ protected ProcessorDefinition doParseProcessorDefinitionRef(String key) throws I
case "split": return doParseSplitDefinition();
case "step": return doParseStepDefinition();
case "stop": return doParseStopDefinition();
+ case "switch": return doParseSwitchDefinition();
case "threads": return doParseThreadsDefinition();
case "throttle": return doParseThrottleDefinition();
case "throwException": return doParseThrowExceptionDefinition();
diff --git a/core/camel-xml-io/src/generated/java/org/apache/camel/xml/out/ModelWriter.java b/core/camel-xml-io/src/generated/java/org/apache/camel/xml/out/ModelWriter.java
index cf985566ea488..0e5b7879ac1ea 100644
--- a/core/camel-xml-io/src/generated/java/org/apache/camel/xml/out/ModelWriter.java
+++ b/core/camel-xml-io/src/generated/java/org/apache/camel/xml/out/ModelWriter.java
@@ -320,6 +320,15 @@ public void writeStepDefinition(StepDefinition def) throws IOException {
public void writeStopDefinition(StopDefinition def) throws IOException {
doWriteStopDefinition("stop", def);
}
+ public void writeSwitchCaseDefinition(SwitchCaseDefinition def) throws IOException {
+ doWriteSwitchCaseDefinition("case", def);
+ }
+ public void writeSwitchDefinition(SwitchDefinition def) throws IOException {
+ doWriteSwitchDefinition("switch", def);
+ }
+ public void writeSwitchOtherwiseDefinition(SwitchOtherwiseDefinition def) throws IOException {
+ doWriteSwitchOtherwiseDefinition("switchOtherwise", def);
+ }
public void writeTemplatedRouteDefinition(TemplatedRouteDefinition def) throws IOException {
doWriteTemplatedRouteDefinition("templatedRoute", def);
}
@@ -1820,6 +1829,26 @@ protected void doWriteStopDefinition(String name, StopDefinition def) throws IOE
doWriteProcessorDefinitionAttributes(def);
endElement(name);
}
+ protected void doWriteSwitchCaseDefinition(String name, SwitchCaseDefinition def) throws IOException {
+ startElement(name);
+ doWriteOptionalIdentifiedDefinitionAttributes(def);
+ doWriteAttribute("value", def.getValue(), null);
+ doWriteAttribute("uri", def.getUri(), null);
+ endElement(name);
+ }
+ protected void doWriteSwitchDefinition(String name, SwitchDefinition def) throws IOException {
+ startElement(name);
+ doWriteProcessorDefinitionAttributes(def);
+ doWriteElement("selector", def.getSelector(), this::doWriteExpressionSubElementDefinition);
+ doWriteList(null, "case", def.getCases(), this::doWriteSwitchCaseDefinition);
+ doWriteElement("otherwise", def.getOtherwise(), this::doWriteSwitchOtherwiseDefinition);
+ endElement(name);
+ }
+ protected void doWriteSwitchOtherwiseDefinition(String name, SwitchOtherwiseDefinition def) throws IOException {
+ startElement(name);
+ doWriteAttribute("uri", def.getUri(), null);
+ endElement(name);
+ }
protected void doWriteTemplatedRouteDefinition(String name, TemplatedRouteDefinition def) throws IOException {
startElement(name);
doWriteAttribute("routeTemplateRef", def.getRouteTemplateRef(), null);
@@ -3725,6 +3754,8 @@ protected void doWriteOptionalIdentifiedDefinitionRef(String n, OptionalIdentifi
case "SplitDefinition" -> doWriteSplitDefinition("split", (SplitDefinition) v);
case "StepDefinition" -> doWriteStepDefinition("step", (StepDefinition) v);
case "StopDefinition" -> doWriteStopDefinition("stop", (StopDefinition) v);
+ case "SwitchCaseDefinition" -> doWriteSwitchCaseDefinition("case", (SwitchCaseDefinition) v);
+ case "SwitchDefinition" -> doWriteSwitchDefinition("switch", (SwitchDefinition) v);
case "TemplatedRoutesDefinition" -> doWriteTemplatedRoutesDefinition("templatedRoutes", (TemplatedRoutesDefinition) v);
case "ThreadPoolProfileDefinition" -> doWriteThreadPoolProfileDefinition("threadPoolProfile", (ThreadPoolProfileDefinition) v);
case "ThreadsDefinition" -> doWriteThreadsDefinition("threads", (ThreadsDefinition) v);
@@ -3823,6 +3854,7 @@ protected void doWriteProcessorDefinitionRef(String n, ProcessorDefinition v) th
case "SplitDefinition" -> doWriteSplitDefinition("split", (SplitDefinition) v);
case "StepDefinition" -> doWriteStepDefinition("step", (StepDefinition) v);
case "StopDefinition" -> doWriteStopDefinition("stop", (StopDefinition) v);
+ case "SwitchDefinition" -> doWriteSwitchDefinition("switch", (SwitchDefinition) v);
case "ThreadsDefinition" -> doWriteThreadsDefinition("threads", (ThreadsDefinition) v);
case "ThrottleDefinition" -> doWriteThrottleDefinition("throttle", (ThrottleDefinition) v);
case "ThrowExceptionDefinition" -> doWriteThrowExceptionDefinition("throwException", (ThrowExceptionDefinition) v);
diff --git a/core/camel-xml-io/src/main/java/org/apache/camel/xml/LwModelToXMLDumper.java b/core/camel-xml-io/src/main/java/org/apache/camel/xml/LwModelToXMLDumper.java
index 842c451ade16f..9ebc1f2338684 100644
--- a/core/camel-xml-io/src/main/java/org/apache/camel/xml/LwModelToXMLDumper.java
+++ b/core/camel-xml-io/src/main/java/org/apache/camel/xml/LwModelToXMLDumper.java
@@ -44,6 +44,7 @@
import org.apache.camel.model.RouteTemplatesDefinition;
import org.apache.camel.model.RoutesDefinition;
import org.apache.camel.model.SendDefinition;
+import org.apache.camel.model.SwitchDefinition;
import org.apache.camel.model.ToDynamicDefinition;
import org.apache.camel.model.dataformat.DataFormatsDefinition;
import org.apache.camel.model.language.ExpressionDefinition;
@@ -247,6 +248,13 @@ public String dumpDataFormatsAsXml(CamelContext context, Map dat
* @param namespaces the map of namespaces to add discovered XML namespaces into
*/
private static void extractNamespaces(RouteDefinition route, Map namespaces) {
+ for (SwitchDefinition sw : filterTypeInOutputs(route.getOutputs(), SwitchDefinition.class)) {
+ sw.preCreateProcessor();
+ NamespaceAware aware = getNamespaceAwareFromExpression(sw);
+ if (aware != null && aware.getNamespaces() != null) {
+ namespaces.putAll(aware.getNamespaces());
+ }
+ }
for (ExpressionNode en : filterTypeInOutputs(route.getOutputs(), ExpressionNode.class)) {
NamespaceAware na = getNamespaceAwareFromExpression(en);
if (na != null) {
@@ -327,6 +335,17 @@ private static Runnable resolveEndpointDslUris(RouteDefinition route) {
return () -> restorers.forEach(Runnable::run);
}
+ private static NamespaceAware getNamespaceAwareFromExpression(SwitchDefinition definition) {
+ if (definition.getSelector() == null || definition.getSelector().getExpressionType() == null) {
+ return null;
+ }
+ ExpressionDefinition expression = definition.getSelector().getExpressionType();
+ if (expression.getExpressionValue() instanceof NamespaceAware aware) {
+ return aware;
+ }
+ return expression instanceof NamespaceAware aware ? aware : null;
+ }
+
private static NamespaceAware getNamespaceAwareFromExpression(ExpressionNode expressionNode) {
ExpressionDefinition ed = expressionNode.getExpression();
diff --git a/core/camel-xml-jaxb/src/main/java/org/apache/camel/xml/jaxb/JaxbHelper.java b/core/camel-xml-jaxb/src/main/java/org/apache/camel/xml/jaxb/JaxbHelper.java
index 510ced30b7517..62c746934a2f8 100644
--- a/core/camel-xml-jaxb/src/main/java/org/apache/camel/xml/jaxb/JaxbHelper.java
+++ b/core/camel-xml-jaxb/src/main/java/org/apache/camel/xml/jaxb/JaxbHelper.java
@@ -56,6 +56,7 @@
import org.apache.camel.model.RouteTemplatesDefinition;
import org.apache.camel.model.RoutesDefinition;
import org.apache.camel.model.SendDefinition;
+import org.apache.camel.model.SwitchDefinition;
import org.apache.camel.model.TemplatedRouteDefinition;
import org.apache.camel.model.TemplatedRoutesDefinition;
import org.apache.camel.model.ToDynamicDefinition;
@@ -87,6 +88,13 @@ public static JAXBContext getJAXBContext(CamelContext context) throws Exception
* @param namespaces the map of namespaces to add discovered XML namespaces into
*/
public static void extractNamespaces(RouteDefinition route, Map namespaces) {
+ for (SwitchDefinition sw : filterTypeInOutputs(route.getOutputs(), SwitchDefinition.class)) {
+ sw.preCreateProcessor();
+ NamespaceAware aware = getNamespaceAwareFromExpression(sw);
+ if (aware != null && aware.getNamespaces() != null) {
+ namespaces.putAll(aware.getNamespaces());
+ }
+ }
for (ExpressionNode en : filterTypeInOutputs(route.getOutputs(), ExpressionNode.class)) {
NamespaceAware na = getNamespaceAwareFromExpression(en);
if (na != null) {
@@ -165,6 +173,17 @@ public static Runnable resolveEndpointDslUris(RouteDefinition route) {
return () -> restorers.forEach(Runnable::run);
}
+ private static NamespaceAware getNamespaceAwareFromExpression(SwitchDefinition definition) {
+ if (definition.getSelector() == null || definition.getSelector().getExpressionType() == null) {
+ return null;
+ }
+ ExpressionDefinition expression = definition.getSelector().getExpressionType();
+ if (expression.getExpressionValue() instanceof NamespaceAware aware) {
+ return aware;
+ }
+ return expression instanceof NamespaceAware aware ? aware : null;
+ }
+
private static NamespaceAware getNamespaceAwareFromExpression(ExpressionNode expressionNode) {
ExpressionDefinition ed = expressionNode.getExpression();
@@ -265,6 +284,12 @@ public static void extractSourceLocations(Element element, Map namespaces) {
+ for (SwitchDefinition sw : filterTypeInOutputs(route.getOutputs(), SwitchDefinition.class)) {
+ NamespaceAware aware = getNamespaceAwareFromExpression(sw);
+ if (aware != null) {
+ aware.setNamespaces(namespaces);
+ }
+ }
Collection col = filterTypeInOutputs(route.getOutputs(), ExpressionNode.class);
for (ExpressionNode en : col) {
NamespaceAware na = getNamespaceAwareFromExpression(en);
@@ -289,6 +314,12 @@ public static void applyNamespaces(RouteConfigurationDefinition config, Map def : defs) {
+ for (SwitchDefinition sw : filterTypeInOutputs(def.getOutputs(), SwitchDefinition.class)) {
+ NamespaceAware aware = getNamespaceAwareFromExpression(sw);
+ if (aware != null) {
+ aware.setNamespaces(namespaces);
+ }
+ }
Collection col = filterTypeInOutputs(def.getOutputs(), ExpressionNode.class);
for (ExpressionNode en : col) {
NamespaceAware na = getNamespaceAwareFromExpression(en);
diff --git a/core/camel-yaml-io/src/generated/java/org/apache/camel/yaml/out/YamlModelWriter.java b/core/camel-yaml-io/src/generated/java/org/apache/camel/yaml/out/YamlModelWriter.java
index 0753ef039cb4c..55f7b50c48ca6 100644
--- a/core/camel-yaml-io/src/generated/java/org/apache/camel/yaml/out/YamlModelWriter.java
+++ b/core/camel-yaml-io/src/generated/java/org/apache/camel/yaml/out/YamlModelWriter.java
@@ -313,6 +313,15 @@ public JsonObject writeStepDefinition(StepDefinition def) {
public JsonObject writeStopDefinition(StopDefinition def) {
return wrapNode("stop", doWriteStopDefinition(def));
}
+ public JsonObject writeSwitchCaseDefinition(SwitchCaseDefinition def) {
+ return wrapNode("case", doWriteSwitchCaseDefinition(def));
+ }
+ public JsonObject writeSwitchDefinition(SwitchDefinition def) {
+ return wrapNode("switch", doWriteSwitchDefinition(def));
+ }
+ public JsonObject writeSwitchOtherwiseDefinition(SwitchOtherwiseDefinition def) {
+ return wrapNode("switchOtherwise", doWriteSwitchOtherwiseDefinition(def));
+ }
public JsonObject writeTemplatedRouteDefinition(TemplatedRouteDefinition def) {
return wrapNode("templatedRoute", doWriteTemplatedRouteDefinition(def));
}
@@ -1816,6 +1825,30 @@ protected JsonObject doWriteStopDefinition(StopDefinition def) {
doWriteProcessorDefinitionAttributes(jo, def);
return jo;
}
+ protected JsonObject doWriteSwitchCaseDefinition(SwitchCaseDefinition def) {
+ JsonObject jo = new JsonObject();
+ doWriteOptionalIdentifiedDefinitionAttributes(jo, def);
+ doWriteAttribute(jo, "value", def.getValue(), null);
+ doWriteAttribute(jo, "uri", def.getUri(), null);
+ // Preserve literal strings such as "001" instead of converting them to numbers.
+ if (def.getValue() != null) {
+ jo.put("value", def.getValue());
+ }
+ return jo;
+ }
+ protected JsonObject doWriteSwitchDefinition(SwitchDefinition def) {
+ JsonObject jo = new JsonObject();
+ doWriteProcessorDefinitionAttributes(jo, def);
+ doWriteChildElement(jo, "selector", def.getSelector(), this::doWriteExpressionSubElementDefinition);
+ doWriteChildList(jo, null, "case", def.getCases(), this::doWriteSwitchCaseDefinition);
+ doWriteChildElement(jo, "otherwise", def.getOtherwise(), this::doWriteSwitchOtherwiseDefinition);
+ return jo;
+ }
+ protected JsonObject doWriteSwitchOtherwiseDefinition(SwitchOtherwiseDefinition def) {
+ JsonObject jo = new JsonObject();
+ doWriteAttribute(jo, "uri", def.getUri(), null);
+ return jo;
+ }
protected JsonObject doWriteTemplatedRouteDefinition(TemplatedRouteDefinition def) {
JsonObject jo = new JsonObject();
doWriteAttribute(jo, "routeTemplateRef", def.getRouteTemplateRef(), null);
@@ -3733,6 +3766,8 @@ protected JsonObject doWriteOptionalIdentifiedDefinitionRef(OptionalIdentifiedDe
case "SplitDefinition" -> wrapNode("split", doWriteSplitDefinition((SplitDefinition) v));
case "StepDefinition" -> wrapNode("step", doWriteStepDefinition((StepDefinition) v));
case "StopDefinition" -> wrapNode("stop", doWriteStopDefinition((StopDefinition) v));
+ case "SwitchCaseDefinition" -> wrapNode("case", doWriteSwitchCaseDefinition((SwitchCaseDefinition) v));
+ case "SwitchDefinition" -> wrapNode("switch", doWriteSwitchDefinition((SwitchDefinition) v));
case "TemplatedRoutesDefinition" -> wrapNode("templatedRoutes", doWriteTemplatedRoutesDefinition((TemplatedRoutesDefinition) v));
case "ThreadPoolProfileDefinition" -> wrapNode("threadPoolProfile", doWriteThreadPoolProfileDefinition((ThreadPoolProfileDefinition) v));
case "ThreadsDefinition" -> wrapNode("threads", doWriteThreadsDefinition((ThreadsDefinition) v));
@@ -3835,6 +3870,7 @@ protected JsonObject doWriteProcessorDefinitionRef(ProcessorDefinition v) {
case "SplitDefinition" -> wrapNode("split", doWriteSplitDefinition((SplitDefinition) v));
case "StepDefinition" -> wrapNode("step", doWriteStepDefinition((StepDefinition) v));
case "StopDefinition" -> wrapNode("stop", doWriteStopDefinition((StopDefinition) v));
+ case "SwitchDefinition" -> wrapNode("switch", doWriteSwitchDefinition((SwitchDefinition) v));
case "ThreadsDefinition" -> wrapNode("threads", doWriteThreadsDefinition((ThreadsDefinition) v));
case "ThrottleDefinition" -> wrapNode("throttle", doWriteThrottleDefinition((ThrottleDefinition) v));
case "ThrowExceptionDefinition" -> wrapNode("throwException", doWriteThrowExceptionDefinition((ThrowExceptionDefinition) v));
diff --git a/core/camel-yaml-io/src/main/java/org/apache/camel/yaml/LwModelToYAMLDumper.java b/core/camel-yaml-io/src/main/java/org/apache/camel/yaml/LwModelToYAMLDumper.java
index 9d4f14b3e024c..318e20db2cf95 100644
--- a/core/camel-yaml-io/src/main/java/org/apache/camel/yaml/LwModelToYAMLDumper.java
+++ b/core/camel-yaml-io/src/main/java/org/apache/camel/yaml/LwModelToYAMLDumper.java
@@ -45,6 +45,7 @@
import org.apache.camel.model.RouteTemplatesDefinition;
import org.apache.camel.model.RoutesDefinition;
import org.apache.camel.model.SendDefinition;
+import org.apache.camel.model.SwitchDefinition;
import org.apache.camel.model.ToDynamicDefinition;
import org.apache.camel.model.dataformat.DataFormatsDefinition;
import org.apache.camel.model.language.ExpressionDefinition;
@@ -256,6 +257,13 @@ public String dumpDataFormatsAsYaml(CamelContext context, Map da
* @param namespaces the map of namespaces to add discovered XML namespaces into
*/
private static void extractNamespaces(RouteDefinition route, Map namespaces) {
+ for (SwitchDefinition sw : filterTypeInOutputs(route.getOutputs(), SwitchDefinition.class)) {
+ sw.preCreateProcessor();
+ NamespaceAware aware = getNamespaceAwareFromExpression(sw);
+ if (aware != null && aware.getNamespaces() != null) {
+ namespaces.putAll(aware.getNamespaces());
+ }
+ }
Collection col = filterTypeInOutputs(route.getOutputs(), ExpressionNode.class);
for (ExpressionNode en : col) {
NamespaceAware na = getNamespaceAwareFromExpression(en);
@@ -325,6 +333,17 @@ private static Runnable resolveEndpointDslUris(RouteDefinition route) {
return () -> restorers.forEach(Runnable::run);
}
+ private static NamespaceAware getNamespaceAwareFromExpression(SwitchDefinition definition) {
+ if (definition.getSelector() == null || definition.getSelector().getExpressionType() == null) {
+ return null;
+ }
+ ExpressionDefinition expression = definition.getSelector().getExpressionType();
+ if (expression.getExpressionValue() instanceof NamespaceAware aware) {
+ return aware;
+ }
+ return expression instanceof NamespaceAware aware ? aware : null;
+ }
+
private static NamespaceAware getNamespaceAwareFromExpression(ExpressionNode expressionNode) {
ExpressionDefinition ed = expressionNode.getExpression();
diff --git a/core/camel-yaml-io/src/test/java/org/apache/camel/yaml/io/YamlPrinterTest.java b/core/camel-yaml-io/src/test/java/org/apache/camel/yaml/io/YamlPrinterTest.java
index d07fbc82de04e..d2c5760a3c723 100644
--- a/core/camel-yaml-io/src/test/java/org/apache/camel/yaml/io/YamlPrinterTest.java
+++ b/core/camel-yaml-io/src/test/java/org/apache/camel/yaml/io/YamlPrinterTest.java
@@ -142,6 +142,7 @@ void quotingRules() {
assertTrue(YamlPrinter.needsQuoting("null"), "null");
assertTrue(YamlPrinter.needsQuoting("~"), "tilde");
assertTrue(YamlPrinter.needsQuoting("123"), "integer");
+ assertTrue(YamlPrinter.needsQuoting("001"), "integer with leading zeros");
assertTrue(YamlPrinter.needsQuoting("3.14"), "float");
assertTrue(YamlPrinter.needsQuoting("-42"), "negative number");
assertTrue(YamlPrinter.needsQuoting("foo: bar"), "contains colon-space");
diff --git a/dsl/camel-jbang/camel-jbang-core/src/generated/resources/org/apache/camel/dsl/jbang/core/commands/ai/eip-samples.json b/dsl/camel-jbang/camel-jbang-core/src/generated/resources/org/apache/camel/dsl/jbang/core/commands/ai/eip-samples.json
index 529cbbc4044d6..583da9fce2858 100644
--- a/dsl/camel-jbang/camel-jbang-core/src/generated/resources/org/apache/camel/dsl/jbang/core/commands/ai/eip-samples.json
+++ b/dsl/camel-jbang/camel-jbang-core/src/generated/resources/org/apache/camel/dsl/jbang/core/commands/ai/eip-samples.json
@@ -1403,6 +1403,16 @@
"yaml": "- route:\n from:\n uri: direct:start\n steps:\n - choice:\n when:\n - simple: \"${body} contains 'Hello'\"\n steps:\n - to:\n uri: mock:hello\n - simple: \"${body} contains 'Bye'\"\n steps:\n - to:\n uri: mock:bye\n - stop: {}\n otherwise:\n steps:\n - to:\n uri: mock:other\n - to:\n uri: mock:result\n"
}
],
+ "switch": [
+ {
+ "source": "switch-eip.adoc",
+ "yaml": "- route:\n from:\n uri: direct:tickets\n steps:\n - switch:\n selector:\n header:\n expression: department\n case:\n - value: billing\n uri: direct:billing\n - value: technical\n uri: direct:technical\n otherwise:\n uri: direct:review\n"
+ },
+ {
+ "source": "switch-eip.adoc",
+ "yaml": "- route:\n from:\n uri: direct:billing\n steps:\n - log: \"Billing: ${body}\"\n- route:\n from:\n uri: direct:technical\n steps:\n - log: \"Technical: ${body}\"\n- route:\n from:\n uri: direct:review\n steps:\n - log: \"Review: ${body}\"\n"
+ }
+ ],
"threads": [
{
"source": "threads-eip.adoc",
diff --git a/dsl/camel-xml-io-dsl/src/test/java/org/apache/camel/dsl/xml/io/XmlSwitchTest.java b/dsl/camel-xml-io-dsl/src/test/java/org/apache/camel/dsl/xml/io/XmlSwitchTest.java
new file mode 100644
index 0000000000000..11903a0c3a9e8
--- /dev/null
+++ b/dsl/camel-xml-io-dsl/src/test/java/org/apache/camel/dsl/xml/io/XmlSwitchTest.java
@@ -0,0 +1,103 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.dsl.xml.io;
+
+import org.apache.camel.impl.DefaultCamelContext;
+import org.apache.camel.model.RouteDefinition;
+import org.apache.camel.model.SwitchDefinition;
+import org.apache.camel.model.language.XPathExpression;
+import org.apache.camel.support.PluginHelper;
+import org.apache.camel.support.ResourceHelper;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+class XmlSwitchTest {
+ @Test
+ void fluentSelectorSurvivesDumpBeforeStartup() throws Exception {
+ try (var context = new DefaultCamelContext()) {
+ RouteDefinition route = new RouteDefinition("direct:start").routeId("fluent");
+ route.doSwitch().header("department").otherwise("mock:other");
+ String xml = PluginHelper.getModelToXMLDumper(context).dumpModelAsXml(context, route);
+ PluginHelper.getRoutesLoader(context).loadRoutes(ResourceHelper.fromString("fluent.xml", xml));
+ SwitchDefinition sw = (SwitchDefinition) context.getRouteDefinition("fluent").getOutputs().get(0);
+ assertEquals("header", sw.getSelector().getExpressionType().getLanguage());
+ assertEquals("department", sw.getSelector().getExpressionType().getExpression());
+ }
+ }
+
+ @Test
+ void selectorNamespacesSurviveModelDump() throws Exception {
+ String xml = """
+
+
+
+
+ string(/t:ticket/t:department)
+
+
+
+ matched
+
+ """;
+ try (var context = new DefaultCamelContext(); var restored = new DefaultCamelContext()) {
+ PluginHelper.getRoutesLoader(context).loadRoutes(ResourceHelper.fromString("selector.xml", xml));
+ String roundTrip = PluginHelper.getModelToXMLDumper(context)
+ .dumpModelAsXml(context, context.getRouteDefinition("selector"));
+ PluginHelper.getRoutesLoader(restored).loadRoutes(ResourceHelper.fromString("restored.xml", roundTrip));
+ SwitchDefinition sw = (SwitchDefinition) restored.getRouteDefinition("selector").getOutputs().get(0);
+ assertEquals("urn:tickets", ((XPathExpression) sw.getSelector().getExpressionType()).getNamespaces().get("t"));
+ context.start();
+ try (var template = context.createProducerTemplate()) {
+ assertEquals("matched", template.requestBody("direct:start",
+ "billing"));
+ }
+ }
+ }
+
+ @Test
+ void scalarRoundTripPreservesFallbackAndExecutes() throws Exception {
+ String xml = """
+
+
+
+
+
+
+
+
+
+ matched
+ other
+
+ """;
+ try (var context = new DefaultCamelContext(); var restored = new DefaultCamelContext()) {
+ PluginHelper.getRoutesLoader(context).loadRoutes(ResourceHelper.fromString("selector.xml", xml));
+ for (var route : context.getRouteDefinitions()) {
+ String roundTrip = PluginHelper.getModelToXMLDumper(context).dumpModelAsXml(context, route);
+ PluginHelper.getRoutesLoader(restored).loadRoutes(ResourceHelper.fromString(route.getId() + ".xml", roundTrip));
+ }
+ restored.start();
+ try (var template = restored.createProducerTemplate()) {
+ assertEquals("matched", template.requestBodyAndHeader("direct:start", "original", "decision",
+ "BILLING"));
+ assertEquals("other", template.requestBodyAndHeader("direct:start", "original", "decision",
+ "other"));
+ }
+ }
+ }
+}
diff --git a/dsl/camel-yaml-dsl/camel-yaml-dsl-deserializers/src/generated/java/org/apache/camel/dsl/yaml/deserializers/ModelDeserializers.java b/dsl/camel-yaml-dsl/camel-yaml-dsl-deserializers/src/generated/java/org/apache/camel/dsl/yaml/deserializers/ModelDeserializers.java
index 024263761443c..883bd2d30b8d7 100644
--- a/dsl/camel-yaml-dsl/camel-yaml-dsl-deserializers/src/generated/java/org/apache/camel/dsl/yaml/deserializers/ModelDeserializers.java
+++ b/dsl/camel-yaml-dsl/camel-yaml-dsl-deserializers/src/generated/java/org/apache/camel/dsl/yaml/deserializers/ModelDeserializers.java
@@ -93,6 +93,9 @@
import org.apache.camel.model.SplitDefinition;
import org.apache.camel.model.StepDefinition;
import org.apache.camel.model.StopDefinition;
+import org.apache.camel.model.SwitchCaseDefinition;
+import org.apache.camel.model.SwitchDefinition;
+import org.apache.camel.model.SwitchOtherwiseDefinition;
import org.apache.camel.model.TemplatedRouteParameterDefinition;
import org.apache.camel.model.ThreadPoolProfileDefinition;
import org.apache.camel.model.ThreadsDefinition;
@@ -18034,6 +18037,197 @@ protected boolean setProperty(SwiftMxDataFormat target, String propertyKey,
}
}
+ @YamlType(
+ nodes = "case",
+ types = org.apache.camel.model.SwitchCaseDefinition.class,
+ order = org.apache.camel.dsl.yaml.common.YamlDeserializerResolver.ORDER_LOWEST - 1,
+ displayName = "Case",
+ description = "A literal switch case with one fixed endpoint destination",
+ deprecated = false,
+ properties = {
+ @YamlProperty(name = "description", type = "string", description = "The description for this node", displayName = "Description"),
+ @YamlProperty(name = "id", type = "string", description = "The id of this node", displayName = "Id"),
+ @YamlProperty(name = "note", type = "string", description = "The note for this node", displayName = "Note"),
+ @YamlProperty(name = "parameters", type = "object"),
+ @YamlProperty(name = "uri", type = "string", required = true, description = "The fixed destination URI. Supports property placeholders, but not Simple expressions.", displayName = "Uri"),
+ @YamlProperty(name = "value", type = "string", required = true, description = "The case-insensitive literal value for a scalar selector.", displayName = "Value")
+ }
+ )
+ public static class SwitchCaseDefinitionDeserializer extends YamlDeserializerEndpointAwareBase {
+ public SwitchCaseDefinitionDeserializer() {
+ super(SwitchCaseDefinition.class);
+ }
+
+ @Override
+ protected SwitchCaseDefinition newInstance() {
+ return new SwitchCaseDefinition();
+ }
+
+ @Override
+ protected void setEndpointUri(CamelContext camelContext, Node node,
+ SwitchCaseDefinition target, Map parameters) {
+ target.setUri(org.apache.camel.dsl.yaml.common.YamlSupport.createEndpointUri(camelContext, node, target.getUri(), parameters));
+ }
+
+ @Override
+ protected boolean setProperty(SwitchCaseDefinition target, String propertyKey,
+ String propertyName, Node node) {
+ propertyKey = org.apache.camel.util.StringHelper.dashToCamelCase(propertyKey);
+ switch(propertyKey) {
+ case "uri": {
+ String val = asText(node);
+ target.setUri(val);
+ break;
+ }
+ case "value": {
+ String val = asText(node);
+ target.setValue(val);
+ break;
+ }
+ case "id": {
+ String val = asText(node);
+ target.setId(val);
+ break;
+ }
+ case "description": {
+ String val = asText(node);
+ target.setDescription(val);
+ break;
+ }
+ case "note": {
+ String val = asText(node);
+ target.setNote(val);
+ break;
+ }
+ default: {
+ return false;
+ }
+ }
+ return true;
+ }
+ }
+
+ @YamlType(
+ nodes = "switch",
+ types = org.apache.camel.model.SwitchDefinition.class,
+ order = org.apache.camel.dsl.yaml.common.YamlDeserializerResolver.ORDER_LOWEST - 1,
+ displayName = "Switch",
+ description = "Evaluates a selector once and dispatches to a fixed endpoint by literal scalar values",
+ deprecated = false,
+ properties = {
+ @YamlProperty(name = "case", type = "array:org.apache.camel.model.SwitchCaseDefinition", description = "Literal cases. Duplicate values are rejected at startup, ignoring case.", displayName = "Case"),
+ @YamlProperty(name = "description", type = "string", description = "The description for this node", displayName = "Description"),
+ @YamlProperty(name = "disabled", type = "boolean", defaultValue = "false", description = "Whether to disable this EIP from the route during build time. Once an EIP has been disabled then it cannot be enabled later at runtime.", displayName = "Disabled"),
+ @YamlProperty(name = "id", type = "string", description = "The id of this node", displayName = "Id"),
+ @YamlProperty(name = "note", type = "string", description = "The note for this node", displayName = "Note"),
+ @YamlProperty(name = "otherwise", type = "object:org.apache.camel.model.SwitchOtherwiseDefinition", description = "Fixed fallback URI for null or unmatched selector results. Without a fallback processing continues.", displayName = "Otherwise"),
+ @YamlProperty(name = "selector", type = "object:org.apache.camel.model.ExpressionSubElementDefinition", required = true, description = "Expression evaluated once per entry. Returns a scalar value to match against the literal cases.", displayName = "Selector")
+ }
+ )
+ public static class SwitchDefinitionDeserializer extends YamlDeserializerBase {
+ public SwitchDefinitionDeserializer() {
+ super(SwitchDefinition.class);
+ }
+
+ @Override
+ protected SwitchDefinition newInstance() {
+ return new SwitchDefinition();
+ }
+
+ @Override
+ protected boolean setProperty(SwitchDefinition target, String propertyKey,
+ String propertyName, Node node) {
+ propertyKey = org.apache.camel.util.StringHelper.dashToCamelCase(propertyKey);
+ switch(propertyKey) {
+ case "case": {
+ java.util.List val = asFlatList(node, org.apache.camel.model.SwitchCaseDefinition.class);
+ target.setCases(val);
+ break;
+ }
+ case "disabled": {
+ String val = asText(node);
+ target.setDisabled(val);
+ break;
+ }
+ case "otherwise": {
+ org.apache.camel.model.SwitchOtherwiseDefinition val = asType(node, org.apache.camel.model.SwitchOtherwiseDefinition.class);
+ target.setOtherwise(val);
+ break;
+ }
+ case "selector": {
+ org.apache.camel.model.ExpressionSubElementDefinition val = asType(node, org.apache.camel.model.ExpressionSubElementDefinition.class);
+ target.setSelector(val);
+ break;
+ }
+ case "id": {
+ String val = asText(node);
+ target.setId(val);
+ break;
+ }
+ case "description": {
+ String val = asText(node);
+ target.setDescription(val);
+ break;
+ }
+ case "note": {
+ String val = asText(node);
+ target.setNote(val);
+ break;
+ }
+ default: {
+ return false;
+ }
+ }
+ return true;
+ }
+ }
+
+ @YamlType(
+ nodes = "switchOtherwise",
+ types = org.apache.camel.model.SwitchOtherwiseDefinition.class,
+ order = org.apache.camel.dsl.yaml.common.YamlDeserializerResolver.ORDER_LOWEST - 1,
+ displayName = "Switch Otherwise",
+ description = "The fixed endpoint used when no switch case matches",
+ deprecated = false,
+ properties = {
+ @YamlProperty(name = "parameters", type = "object"),
+ @YamlProperty(name = "uri", type = "string", required = true, description = "The fixed destination URI. Supports property placeholders, but not Simple expressions.", displayName = "Uri")
+ }
+ )
+ public static class SwitchOtherwiseDefinitionDeserializer extends YamlDeserializerEndpointAwareBase {
+ public SwitchOtherwiseDefinitionDeserializer() {
+ super(SwitchOtherwiseDefinition.class);
+ }
+
+ @Override
+ protected SwitchOtherwiseDefinition newInstance() {
+ return new SwitchOtherwiseDefinition();
+ }
+
+ @Override
+ protected void setEndpointUri(CamelContext camelContext, Node node,
+ SwitchOtherwiseDefinition target, Map parameters) {
+ target.setUri(org.apache.camel.dsl.yaml.common.YamlSupport.createEndpointUri(camelContext, node, target.getUri(), parameters));
+ }
+
+ @Override
+ protected boolean setProperty(SwitchOtherwiseDefinition target, String propertyKey,
+ String propertyName, Node node) {
+ propertyKey = org.apache.camel.util.StringHelper.dashToCamelCase(propertyKey);
+ switch(propertyKey) {
+ case "uri": {
+ String val = asText(node);
+ target.setUri(val);
+ break;
+ }
+ default: {
+ return false;
+ }
+ }
+ return true;
+ }
+ }
+
@YamlType(
nodes = "syslog",
types = org.apache.camel.model.dataformat.SyslogDataFormat.class,
diff --git a/dsl/camel-yaml-dsl/camel-yaml-dsl-deserializers/src/generated/java/org/apache/camel/dsl/yaml/deserializers/ModelDeserializersResolver.java b/dsl/camel-yaml-dsl/camel-yaml-dsl-deserializers/src/generated/java/org/apache/camel/dsl/yaml/deserializers/ModelDeserializersResolver.java
index 03f919086535b..853a854e8332f 100644
--- a/dsl/camel-yaml-dsl/camel-yaml-dsl-deserializers/src/generated/java/org/apache/camel/dsl/yaml/deserializers/ModelDeserializersResolver.java
+++ b/dsl/camel-yaml-dsl/camel-yaml-dsl-deserializers/src/generated/java/org/apache/camel/dsl/yaml/deserializers/ModelDeserializersResolver.java
@@ -403,6 +403,12 @@ public ConstructNode resolve(String id) {
case "org.apache.camel.model.dataformat.SwiftMtDataFormat": return new ModelDeserializers.SwiftMtDataFormatDeserializer();
case "swiftMx": return new ModelDeserializers.SwiftMxDataFormatDeserializer();
case "org.apache.camel.model.dataformat.SwiftMxDataFormat": return new ModelDeserializers.SwiftMxDataFormatDeserializer();
+ case "case": return new ModelDeserializers.SwitchCaseDefinitionDeserializer();
+ case "org.apache.camel.model.SwitchCaseDefinition": return new ModelDeserializers.SwitchCaseDefinitionDeserializer();
+ case "switch": return new ModelDeserializers.SwitchDefinitionDeserializer();
+ case "org.apache.camel.model.SwitchDefinition": return new ModelDeserializers.SwitchDefinitionDeserializer();
+ case "switchOtherwise": return new ModelDeserializers.SwitchOtherwiseDefinitionDeserializer();
+ case "org.apache.camel.model.SwitchOtherwiseDefinition": return new ModelDeserializers.SwitchOtherwiseDefinitionDeserializer();
case "syslog": return new ModelDeserializers.SyslogDataFormatDeserializer();
case "org.apache.camel.model.dataformat.SyslogDataFormat": return new ModelDeserializers.SyslogDataFormatDeserializer();
case "tarFile": return new ModelDeserializers.TarFileDataFormatDeserializer();
diff --git a/dsl/camel-yaml-dsl/camel-yaml-dsl-maven-plugin/src/main/java/org/apache/camel/maven/dsl/yaml/GenerateYamlDeserializersMojo.java b/dsl/camel-yaml-dsl/camel-yaml-dsl-maven-plugin/src/main/java/org/apache/camel/maven/dsl/yaml/GenerateYamlDeserializersMojo.java
index 3c01b90d1e7e3..5f57e840897df 100644
--- a/dsl/camel-yaml-dsl/camel-yaml-dsl-maven-plugin/src/main/java/org/apache/camel/maven/dsl/yaml/GenerateYamlDeserializersMojo.java
+++ b/dsl/camel-yaml-dsl/camel-yaml-dsl-maven-plugin/src/main/java/org/apache/camel/maven/dsl/yaml/GenerateYamlDeserializersMojo.java
@@ -407,8 +407,7 @@ private TypeSpecHolder generateParser(ClassInfo info) {
builder.addModifiers(Modifier.PUBLIC, Modifier.STATIC);
- if (extendsType(info, SEND_DEFINITION_CLASS) || extendsType(info, TO_DYNAMIC_DEFINITION_CLASS)
- || extendsType(info, POLL_DEFINITION_CLASS)) {
+ if (implementType(info, ENDPOINT_REQUIRED_DEFINITION_CLASS) || extendsType(info, TO_DYNAMIC_DEFINITION_CLASS)) {
builder.superclass(ParameterizedTypeName.get(CN_ENDPOINT_AWARE_DESERIALIZER_BASE, targetType));
} else {
builder.superclass(ParameterizedTypeName.get(CN_DESERIALIZER_BASE, targetType));
@@ -588,8 +587,7 @@ private TypeSpecHolder generateParser(ClassInfo info) {
"array:org.apache.camel.model.ProcessorDefinition"));
}
- if (extendsType(info, SEND_DEFINITION_CLASS) || extendsType(info, TO_DYNAMIC_DEFINITION_CLASS)
- || extendsType(info, POLL_DEFINITION_CLASS)) {
+ if (implementType(info, ENDPOINT_REQUIRED_DEFINITION_CLASS) || extendsType(info, TO_DYNAMIC_DEFINITION_CLASS)) {
setProperty.beginControlFlow("default:");
setProperty.addStatement("return false");
setProperty.endControlFlow();
diff --git a/dsl/camel-yaml-dsl/camel-yaml-dsl-maven-plugin/src/main/java/org/apache/camel/maven/dsl/yaml/GenerateYamlSupportMojo.java b/dsl/camel-yaml-dsl/camel-yaml-dsl-maven-plugin/src/main/java/org/apache/camel/maven/dsl/yaml/GenerateYamlSupportMojo.java
index d79d6ecbfc6c3..c843862441074 100644
--- a/dsl/camel-yaml-dsl/camel-yaml-dsl-maven-plugin/src/main/java/org/apache/camel/maven/dsl/yaml/GenerateYamlSupportMojo.java
+++ b/dsl/camel-yaml-dsl/camel-yaml-dsl-maven-plugin/src/main/java/org/apache/camel/maven/dsl/yaml/GenerateYamlSupportMojo.java
@@ -101,12 +101,10 @@ public abstract class GenerateYamlSupportMojo extends AbstractMojo {
= DotName.createSimple("org.apache.camel.model.OutputNode");
public static final DotName PROCESSOR_DEFINITION_CLASS
= DotName.createSimple("org.apache.camel.model.ProcessorDefinition");
- public static final DotName SEND_DEFINITION_CLASS
- = DotName.createSimple("org.apache.camel.model.SendDefinition");
+ public static final DotName ENDPOINT_REQUIRED_DEFINITION_CLASS
+ = DotName.createSimple("org.apache.camel.model.EndpointRequiredDefinition");
public static final DotName TO_DYNAMIC_DEFINITION_CLASS
= DotName.createSimple("org.apache.camel.model.ToDynamicDefinition");
- public static final DotName POLL_DEFINITION_CLASS
- = DotName.createSimple("org.apache.camel.model.PollDefinition");
public static final DotName ERROR_HANDLER_BUILDER_CLASS
= DotName.createSimple("org.apache.camel.builder.ErrorHandlerBuilder");
public static final DotName VERB_DEFINITION_CLASS
diff --git a/dsl/camel-yaml-dsl/camel-yaml-dsl-validator/src/test/java/org/apache/camel/dsl/yaml/validator/SwitchSchemaTest.java b/dsl/camel-yaml-dsl/camel-yaml-dsl-validator/src/test/java/org/apache/camel/dsl/yaml/validator/SwitchSchemaTest.java
new file mode 100644
index 0000000000000..9d853b1943434
--- /dev/null
+++ b/dsl/camel-yaml-dsl/camel-yaml-dsl-validator/src/test/java/org/apache/camel/dsl/yaml/validator/SwitchSchemaTest.java
@@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.dsl.yaml.validator;
+
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.ValueSource;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+class SwitchSchemaTest {
+ @ParameterizedTest
+ @ValueSource(booleans = { false, true })
+ void fallbackIsAnEndpointObject(boolean canonical) throws Exception {
+ YamlValidator validator = new YamlValidator(canonical);
+ String route = """
+ - route:
+ from:
+ uri: direct:start
+ steps:
+ - switch:
+ selector:
+ header:
+ expression: department
+ case:
+ - value: billing
+ uri: direct:billing
+ otherwise:
+ uri: direct:review
+ """;
+ assertThat(validator.validate(route)).isEmpty();
+ assertThat(validator.validate(route.replace("case:", "keys: [department, urgent]\n case:")))
+ .isNotEmpty();
+ assertThat(validator.validate(route.replace("value: billing", "values: [department: billing]")))
+ .isNotEmpty();
+ for (String fallback : new String[] { "direct:review", "{}", "{steps: [{to: {uri: direct:review}}]}" }) {
+ String invalid = route.replace("otherwise:\n uri: direct:review", "otherwise: " + fallback);
+ assertThat(validator.validate(invalid)).as("fallback: %s", fallback).isNotEmpty();
+ }
+ }
+}
diff --git a/dsl/camel-yaml-dsl/camel-yaml-dsl/pom.xml b/dsl/camel-yaml-dsl/camel-yaml-dsl/pom.xml
index ab1611cab578a..341553734b810 100644
--- a/dsl/camel-yaml-dsl/camel-yaml-dsl/pom.xml
+++ b/dsl/camel-yaml-dsl/camel-yaml-dsl/pom.xml
@@ -67,6 +67,11 @@
assertj-core
test
+
+ org.apache.camel
+ camel-yaml-io
+ test
+
org.apache.camel
camel-main
diff --git a/dsl/camel-yaml-dsl/camel-yaml-dsl/src/generated/resources/schema/camelYamlDsl-canonical.json b/dsl/camel-yaml-dsl/camel-yaml-dsl/src/generated/resources/schema/camelYamlDsl-canonical.json
index 4a8457cd9b096..1e6fd6f8c93da 100644
--- a/dsl/camel-yaml-dsl/camel-yaml-dsl/src/generated/resources/schema/camelYamlDsl-canonical.json
+++ b/dsl/camel-yaml-dsl/camel-yaml-dsl/src/generated/resources/schema/camelYamlDsl-canonical.json
@@ -169,6 +169,9 @@
"stop" : {
"$ref" : "#/items/definitions/org.apache.camel.model.StopDefinition"
},
+ "switch" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.SwitchDefinition"
+ },
"threads" : {
"$ref" : "#/items/definitions/org.apache.camel.model.ThreadsDefinition"
},
@@ -4935,6 +4938,108 @@
}
}
},
+ "org.apache.camel.model.SwitchCaseDefinition" : {
+ "title" : "Case",
+ "description" : "A literal switch case with one fixed endpoint destination",
+ "type" : "object",
+ "additionalProperties" : false,
+ "properties" : {
+ "description" : {
+ "type" : "string",
+ "title" : "Description",
+ "description" : "The description for this node"
+ },
+ "id" : {
+ "type" : "string",
+ "title" : "Id",
+ "description" : "The id of this node"
+ },
+ "note" : {
+ "type" : "string",
+ "title" : "Note",
+ "description" : "The note for this node"
+ },
+ "parameters" : {
+ "type" : "object"
+ },
+ "uri" : {
+ "type" : "string",
+ "title" : "Uri",
+ "description" : "The fixed destination URI. Supports property placeholders, but not Simple expressions."
+ },
+ "value" : {
+ "type" : "string",
+ "title" : "Value",
+ "description" : "The case-insensitive literal value for a scalar selector."
+ }
+ },
+ "required" : [ "uri", "value" ]
+ },
+ "org.apache.camel.model.SwitchDefinition" : {
+ "title" : "Switch",
+ "description" : "Evaluates a selector once and dispatches to a fixed endpoint by literal scalar values",
+ "type" : "object",
+ "additionalProperties" : false,
+ "properties" : {
+ "case" : {
+ "type" : "array",
+ "title" : "Case",
+ "description" : "Literal cases. Duplicate values are rejected at startup, ignoring case.",
+ "items" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.SwitchCaseDefinition"
+ }
+ },
+ "description" : {
+ "type" : "string",
+ "title" : "Description",
+ "description" : "The description for this node"
+ },
+ "disabled" : {
+ "type" : "boolean",
+ "title" : "Disabled",
+ "description" : "Whether to disable this EIP from the route during build time. Once an EIP has been disabled then it cannot be enabled later at runtime.",
+ "default" : false
+ },
+ "id" : {
+ "type" : "string",
+ "title" : "Id",
+ "description" : "The id of this node"
+ },
+ "note" : {
+ "type" : "string",
+ "title" : "Note",
+ "description" : "The note for this node"
+ },
+ "otherwise" : {
+ "title" : "Otherwise",
+ "description" : "Fixed fallback URI for null or unmatched selector results. Without a fallback processing continues.",
+ "$ref" : "#/items/definitions/org.apache.camel.model.SwitchOtherwiseDefinition"
+ },
+ "selector" : {
+ "title" : "Selector",
+ "description" : "Expression evaluated once per entry. Returns a scalar value to match against the literal cases.",
+ "$ref" : "#/items/definitions/org.apache.camel.model.ExpressionSubElementDefinition"
+ }
+ },
+ "required" : [ "selector" ]
+ },
+ "org.apache.camel.model.SwitchOtherwiseDefinition" : {
+ "title" : "Switch Otherwise",
+ "description" : "The fixed endpoint used when no switch case matches",
+ "type" : "object",
+ "additionalProperties" : false,
+ "properties" : {
+ "parameters" : {
+ "type" : "object"
+ },
+ "uri" : {
+ "type" : "string",
+ "title" : "Uri",
+ "description" : "The fixed destination URI. Supports property placeholders, but not Simple expressions."
+ }
+ },
+ "required" : [ "uri" ]
+ },
"org.apache.camel.model.TemplatedRouteDefinition" : {
"type" : "object",
"additionalProperties" : false,
diff --git a/dsl/camel-yaml-dsl/camel-yaml-dsl/src/generated/resources/schema/camelYamlDsl-model.json b/dsl/camel-yaml-dsl/camel-yaml-dsl/src/generated/resources/schema/camelYamlDsl-model.json
index f8c769681a031..d14e31756b498 100644
--- a/dsl/camel-yaml-dsl/camel-yaml-dsl/src/generated/resources/schema/camelYamlDsl-model.json
+++ b/dsl/camel-yaml-dsl/camel-yaml-dsl/src/generated/resources/schema/camelYamlDsl-model.json
@@ -505,6 +505,13 @@
"title" : "Stop",
"description" : "Stops processing of the current message and marks the exchange as completed without sending it to any further steps",
"label" : "eip,flowcontrol,routing"
+ }, {
+ "name" : "switch",
+ "type" : "object",
+ "ref" : "switch",
+ "title" : "Switch",
+ "description" : "Evaluates a selector once and dispatches to a fixed endpoint by literal scalar values",
+ "label" : "eip,routing"
}, {
"name" : "threads",
"type" : "object",
@@ -8323,6 +8330,137 @@
"label" : "advanced"
} ]
},
+ "switchCase" : {
+ "title" : "Case",
+ "description" : "A literal switch case with one fixed endpoint destination",
+ "children" : [ {
+ "name" : "description",
+ "type" : "string",
+ "description" : "The description for this node",
+ "title" : "Description"
+ }, {
+ "name" : "id",
+ "type" : "string",
+ "description" : "The id of this node",
+ "title" : "Id"
+ }, {
+ "name" : "note",
+ "type" : "string",
+ "description" : "The note for this node",
+ "title" : "Note"
+ }, {
+ "name" : "parameters",
+ "type" : "object"
+ }, {
+ "name" : "uri",
+ "type" : "string",
+ "description" : "The fixed destination URI. Supports property placeholders, but not Simple expressions.",
+ "title" : "Uri",
+ "required" : true
+ }, {
+ "name" : "value",
+ "type" : "string",
+ "description" : "The case-insensitive literal value for a scalar selector.",
+ "title" : "Value",
+ "required" : true
+ } ]
+ },
+ "switch" : {
+ "title" : "Switch",
+ "description" : "Evaluates a selector once and dispatches to a fixed endpoint by literal scalar values",
+ "label" : "eip,routing",
+ "input" : true,
+ "isListItem" : true,
+ "children" : [ {
+ "name" : "id",
+ "type" : "string",
+ "description" : "The id of this node",
+ "title" : "Id",
+ "displayName" : "Id",
+ "kind" : "attribute",
+ "index" : 0,
+ "group" : "common"
+ }, {
+ "name" : "note",
+ "type" : "string",
+ "description" : "The note for this node",
+ "title" : "Note",
+ "displayName" : "Note",
+ "kind" : "attribute",
+ "index" : 1,
+ "group" : "common"
+ }, {
+ "name" : "description",
+ "type" : "string",
+ "description" : "The description for this node",
+ "title" : "Description",
+ "displayName" : "Description",
+ "kind" : "attribute",
+ "index" : 2,
+ "group" : "common"
+ }, {
+ "name" : "disabled",
+ "type" : "boolean",
+ "description" : "Whether to disable this EIP from the route during build time. Once an EIP has been disabled then it cannot be enabled later at runtime.",
+ "title" : "Disabled",
+ "default" : "false",
+ "displayName" : "Disabled",
+ "kind" : "attribute",
+ "index" : 3,
+ "group" : "advanced",
+ "label" : "advanced"
+ }, {
+ "name" : "selector",
+ "type" : "object",
+ "ref" : "expressionSubElement",
+ "description" : "Expression evaluated once per entry. Returns a scalar value to match against the literal cases.",
+ "title" : "Selector",
+ "required" : true,
+ "displayName" : "Selector",
+ "kind" : "expression",
+ "index" : 4,
+ "group" : "common"
+ }, {
+ "name" : "case",
+ "type" : "array",
+ "ref" : "switchCase",
+ "description" : "Literal cases. Duplicate values are rejected at startup, ignoring case.",
+ "title" : "Case",
+ "displayName" : "Case",
+ "kind" : "element",
+ "index" : 5,
+ "group" : "common"
+ }, {
+ "name" : "otherwise",
+ "type" : "object",
+ "ref" : "switchOtherwise",
+ "description" : "Fixed fallback URI for null or unmatched selector results. Without a fallback processing continues.",
+ "title" : "Otherwise",
+ "displayName" : "Otherwise",
+ "kind" : "element",
+ "index" : 6,
+ "group" : "common"
+ } ]
+ },
+ "switchOtherwise" : {
+ "title" : "Switch Otherwise",
+ "description" : "The fixed endpoint used when no switch case matches",
+ "label" : "configuration",
+ "children" : [ {
+ "name" : "uri",
+ "type" : "string",
+ "description" : "The fixed destination URI. Supports property placeholders, but not Simple expressions.",
+ "title" : "Uri",
+ "required" : true,
+ "displayName" : "Uri",
+ "kind" : "attribute",
+ "index" : 0,
+ "group" : "common"
+ }, {
+ "name" : "parameters",
+ "type" : "object"
+ } ]
+ },
"templatedRoute" : {
"title" : "Templated Route",
"description" : "Creates a route instance from a route template, binding specific parameter values to the template's parameters",
diff --git a/dsl/camel-yaml-dsl/camel-yaml-dsl/src/generated/resources/schema/camelYamlDsl.json b/dsl/camel-yaml-dsl/camel-yaml-dsl/src/generated/resources/schema/camelYamlDsl.json
index 81ddd7f2f1435..b998d8b107b74 100644
--- a/dsl/camel-yaml-dsl/camel-yaml-dsl/src/generated/resources/schema/camelYamlDsl.json
+++ b/dsl/camel-yaml-dsl/camel-yaml-dsl/src/generated/resources/schema/camelYamlDsl.json
@@ -169,6 +169,9 @@
"stop" : {
"$ref" : "#/items/definitions/org.apache.camel.model.StopDefinition"
},
+ "switch" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.SwitchDefinition"
+ },
"threads" : {
"$ref" : "#/items/definitions/org.apache.camel.model.ThreadsDefinition"
},
@@ -6588,6 +6591,108 @@
}
}
},
+ "org.apache.camel.model.SwitchCaseDefinition" : {
+ "title" : "Case",
+ "description" : "A literal switch case with one fixed endpoint destination",
+ "type" : "object",
+ "additionalProperties" : false,
+ "properties" : {
+ "description" : {
+ "type" : "string",
+ "title" : "Description",
+ "description" : "The description for this node"
+ },
+ "id" : {
+ "type" : "string",
+ "title" : "Id",
+ "description" : "The id of this node"
+ },
+ "note" : {
+ "type" : "string",
+ "title" : "Note",
+ "description" : "The note for this node"
+ },
+ "parameters" : {
+ "type" : "object"
+ },
+ "uri" : {
+ "type" : "string",
+ "title" : "Uri",
+ "description" : "The fixed destination URI. Supports property placeholders, but not Simple expressions."
+ },
+ "value" : {
+ "type" : "string",
+ "title" : "Value",
+ "description" : "The case-insensitive literal value for a scalar selector."
+ }
+ },
+ "required" : [ "uri", "value" ]
+ },
+ "org.apache.camel.model.SwitchDefinition" : {
+ "title" : "Switch",
+ "description" : "Evaluates a selector once and dispatches to a fixed endpoint by literal scalar values",
+ "type" : "object",
+ "additionalProperties" : false,
+ "properties" : {
+ "case" : {
+ "type" : "array",
+ "title" : "Case",
+ "description" : "Literal cases. Duplicate values are rejected at startup, ignoring case.",
+ "items" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.SwitchCaseDefinition"
+ }
+ },
+ "description" : {
+ "type" : "string",
+ "title" : "Description",
+ "description" : "The description for this node"
+ },
+ "disabled" : {
+ "type" : "boolean",
+ "title" : "Disabled",
+ "description" : "Whether to disable this EIP from the route during build time. Once an EIP has been disabled then it cannot be enabled later at runtime.",
+ "default" : false
+ },
+ "id" : {
+ "type" : "string",
+ "title" : "Id",
+ "description" : "The id of this node"
+ },
+ "note" : {
+ "type" : "string",
+ "title" : "Note",
+ "description" : "The note for this node"
+ },
+ "otherwise" : {
+ "title" : "Otherwise",
+ "description" : "Fixed fallback URI for null or unmatched selector results. Without a fallback processing continues.",
+ "$ref" : "#/items/definitions/org.apache.camel.model.SwitchOtherwiseDefinition"
+ },
+ "selector" : {
+ "title" : "Selector",
+ "description" : "Expression evaluated once per entry. Returns a scalar value to match against the literal cases.",
+ "$ref" : "#/items/definitions/org.apache.camel.model.ExpressionSubElementDefinition"
+ }
+ },
+ "required" : [ "selector" ]
+ },
+ "org.apache.camel.model.SwitchOtherwiseDefinition" : {
+ "title" : "Switch Otherwise",
+ "description" : "The fixed endpoint used when no switch case matches",
+ "type" : "object",
+ "additionalProperties" : false,
+ "properties" : {
+ "parameters" : {
+ "type" : "object"
+ },
+ "uri" : {
+ "type" : "string",
+ "title" : "Uri",
+ "description" : "The fixed destination URI. Supports property placeholders, but not Simple expressions."
+ }
+ },
+ "required" : [ "uri" ]
+ },
"org.apache.camel.model.TemplatedRouteDefinition" : {
"type" : "object",
"additionalProperties" : false,
diff --git a/dsl/camel-yaml-dsl/camel-yaml-dsl/src/test/java/org/apache/camel/dsl/yaml/SwitchTest.java b/dsl/camel-yaml-dsl/camel-yaml-dsl/src/test/java/org/apache/camel/dsl/yaml/SwitchTest.java
new file mode 100644
index 0000000000000..6150f21829165
--- /dev/null
+++ b/dsl/camel-yaml-dsl/camel-yaml-dsl/src/test/java/org/apache/camel/dsl/yaml/SwitchTest.java
@@ -0,0 +1,159 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.dsl.yaml;
+
+import org.apache.camel.dsl.yaml.support.YamlTestSupport;
+import org.apache.camel.impl.DefaultCamelContext;
+import org.apache.camel.model.SwitchDefinition;
+import org.apache.camel.model.ToDynamicDefinition;
+import org.apache.camel.support.PluginHelper;
+import org.apache.camel.support.ResourceHelper;
+import org.apache.camel.yaml.LwModelToYAMLDumper;
+import org.junit.jupiter.api.Test;
+
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.assertj.core.api.Assertions.assertThatThrownBy;
+
+class SwitchTest extends YamlTestSupport {
+ @Test
+ void scalarValuesAndEndpointParametersRoundTrip() throws Exception {
+ loadRoutes("""
+ - route:
+ id: decision
+ from:
+ uri: direct:start
+ steps:
+ - switch:
+ selector:
+ header:
+ expression: decision
+ case:
+ - value: urgent
+ uri: direct
+ parameters:
+ name: urgent
+ - value: billing
+ uri: direct:billing
+ otherwise:
+ uri: direct
+ parameters:
+ name: review
+ - route:
+ from:
+ uri: direct:urgent
+ steps:
+ - setBody:
+ constant: urgent
+ - route:
+ from:
+ uri: direct:billing
+ steps:
+ - setBody:
+ constant: billing
+ - route:
+ from:
+ uri: direct:review
+ steps:
+ - setBody:
+ constant: review
+ """);
+ SwitchDefinition sw = (SwitchDefinition) context.getRouteDefinition("decision").getOutputs().get(0);
+ assertThat(sw.getCases().get(0).getUri()).isEqualTo("direct:urgent");
+ assertThat(sw.getCases().get(0).getValue()).isEqualTo("urgent");
+ assertThat(sw.getOtherwise().getUri()).isEqualTo("direct:review");
+ try (var restored = new DefaultCamelContext()) {
+ for (var route : context.getRouteDefinitions()) {
+ String yaml = new LwModelToYAMLDumper().dumpModelAsYaml(context, route);
+ PluginHelper.getRoutesLoader(restored).loadRoutes(ResourceHelper.fromString(route.getId() + ".yaml", yaml));
+ }
+ restored.start();
+ try (var template = restored.createProducerTemplate()) {
+ assertThat(template.requestBodyAndHeader("direct:start", "original", "decision",
+ "URGENT")).isEqualTo("urgent");
+ assertThat(template.requestBodyAndHeader("direct:start", "original", "decision",
+ "BILLING")).isEqualTo("billing");
+ assertThat(template.requestBodyAndHeader("direct:start", "original", "decision",
+ "other")).isEqualTo("review");
+ }
+ }
+ }
+
+ @Test
+ void rejectsCompositeConfiguration() throws Exception {
+ String yaml = """
+ - route:
+ from:
+ uri: direct:start
+ steps:
+ - switch:
+ selector:
+ header: decision
+ case:
+ - value: billing
+ uri: mock:billing
+ """;
+ loadRoutes(yaml);
+ assertThatThrownBy(() -> loadRoutesNoValidate(yaml.replace("case:", "keys: [department, urgent]\n case:")))
+ .hasStackTraceContaining("unsupported field: keys");
+ assertThatThrownBy(() -> loadRoutesNoValidate(yaml.replace("value: billing", "values: [department: billing]")))
+ .hasStackTraceContaining("unsupported field: values");
+ }
+
+ @Test
+ void fallbackRequiresAnEndpointObject() {
+ for (String fallback : new String[] { "direct:review", "{steps: [{to: {uri: direct:review}}]}" }) {
+ String yaml = """
+ - route:
+ from:
+ uri: direct:start
+ steps:
+ - switch:
+ selector:
+ header:
+ expression: department
+ case:
+ - value: billing
+ uri: direct:billing
+ otherwise: %s
+ """.formatted(fallback);
+ assertThatThrownBy(() -> loadRoutes(yaml)).isInstanceOf(Exception.class);
+ }
+ }
+
+ @Test
+ void toDStillAcceptsParametersAndRoundTrips() throws Exception {
+ loadRoutes("""
+ - route:
+ id: dynamic
+ from:
+ uri: direct:start
+ steps:
+ - toD:
+ uri: direct
+ parameters:
+ name: "${header.destination}"
+ """);
+ var route = context.getRouteDefinition("dynamic");
+ assertThat(((ToDynamicDefinition) route.getOutputs().get(0)).getUri()).isEqualTo("direct:${header.destination}");
+ String yaml = new LwModelToYAMLDumper().dumpModelAsYaml(context, route);
+ try (var restored = new DefaultCamelContext()) {
+ PluginHelper.getRoutesLoader(restored).loadRoutes(ResourceHelper.fromString("restored.yaml", yaml));
+ assertThat(((ToDynamicDefinition) restored.getRouteDefinition("dynamic").getOutputs().get(0)).getUri())
+ .isEqualTo("direct:${header.destination}");
+ }
+ }
+}
diff --git a/dsl/camel-yaml-dsl/camel-yaml-dsl/src/test/java/org/apache/camel/dsl/yaml/SwitchYamlDumpTest.java b/dsl/camel-yaml-dsl/camel-yaml-dsl/src/test/java/org/apache/camel/dsl/yaml/SwitchYamlDumpTest.java
new file mode 100644
index 0000000000000..58b53b5420c7b
--- /dev/null
+++ b/dsl/camel-yaml-dsl/camel-yaml-dsl/src/test/java/org/apache/camel/dsl/yaml/SwitchYamlDumpTest.java
@@ -0,0 +1,78 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.dsl.yaml;
+
+import java.util.Map;
+
+import org.apache.camel.builder.ExpressionClause;
+import org.apache.camel.dsl.yaml.support.YamlTestSupport;
+import org.apache.camel.model.RouteDefinition;
+import org.apache.camel.model.SwitchDefinition;
+import org.apache.camel.model.language.HeaderExpression;
+import org.apache.camel.model.language.XPathExpression;
+import org.apache.camel.yaml.LwModelToYAMLDumper;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.ValueSource;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+class SwitchYamlDumpTest extends YamlTestSupport {
+ @ParameterizedTest
+ @ValueSource(strings = { "001", "1.00", "1e2", "true" })
+ void scalarLiteralsRemainStringsAfterDump(String value) throws Exception {
+ RouteDefinition route = new RouteDefinition("direct:start").routeId("literal");
+ route.doSwitch(new HeaderExpression("decision")).doCase(value, "mock:matched");
+ String yaml = new LwModelToYAMLDumper().dumpModelAsYaml(context, route);
+ loadRoutes(yaml);
+ SwitchDefinition restored = (SwitchDefinition) context.getRouteDefinition("literal").getOutputs().get(0);
+ assertThat(restored.getCases().get(0).getValue()).isEqualTo(value);
+ }
+
+ @Test
+ void fluentSelectorSurvivesYamlDump() throws Exception {
+ RouteDefinition route = new RouteDefinition().from("direct:start").routeId("fluent");
+ SwitchDefinition sw = route.doSwitch().header("department").doCase("billing", "mock:billing");
+ assertThat(sw.getSelector().getExpressionType().getExpressionValue()).isInstanceOf(ExpressionClause.class);
+ String yaml = new LwModelToYAMLDumper().dumpModelAsYaml(context, route);
+ loadRoutes(yaml);
+ SwitchDefinition restored = (SwitchDefinition) context.getRouteDefinition("fluent").getOutputs().get(0);
+ assertThat(restored.getSelector().getExpressionType().getExpression()).isEqualTo("department");
+ assertThat(restored.getSelector().getExpressionType().getLanguage()).isEqualTo("header");
+ }
+
+ @Test
+ void selectorNamespacesAndLiteralBranchesSurviveYamlDump() throws Exception {
+ XPathExpression selector = new XPathExpression("/t:ticket/t:department/text()");
+ selector.setNamespaces(Map.of("t", "urn:tickets"));
+ RouteDefinition route = new RouteDefinition().from("direct:start").routeId("selector");
+ route.doSwitch(selector).doCase("billing", "mock:billing").otherwise("mock:other");
+ String yaml = new LwModelToYAMLDumper().dumpModelAsYaml(context, route);
+ loadRoutes(yaml);
+ SwitchDefinition restored = (SwitchDefinition) context.getRouteDefinition("selector").getOutputs().get(0);
+ XPathExpression xpath = (XPathExpression) restored.getSelector().getExpressionType();
+ assertThat(xpath.getExpression()).isEqualTo("/t:ticket/t:department/text()");
+ assertThat(xpath.getNamespaces()).containsEntry("t", "urn:tickets");
+ assertThat(restored.getCases().get(0).getValue()).isEqualTo("billing");
+ assertThat(restored.getCases().get(0).getUri()).isEqualTo("mock:billing");
+ assertThat(restored.getOtherwise().getUri()).isEqualTo("mock:other");
+ SwitchDefinition copy = restored.copyDefinition();
+ copy.getOtherwise().setUri("mock:copy");
+ assertThat(restored.getOtherwise().getUri()).isEqualTo("mock:other");
+ assertThat(copy.getOtherwise().getUri()).isEqualTo("mock:copy");
+ }
+}
diff --git a/tooling/maven/camel-package-maven-plugin/src/main/resources/velocity/model-java-dsl-writer.vm b/tooling/maven/camel-package-maven-plugin/src/main/resources/velocity/model-java-dsl-writer.vm
index ac93150b1b3d3..8d389c26aabb3 100644
--- a/tooling/maven/camel-package-maven-plugin/src/main/resources/velocity/model-java-dsl-writer.vm
+++ b/tooling/maven/camel-package-maven-plugin/src/main/resources/velocity/model-java-dsl-writer.vm
@@ -67,6 +67,8 @@ public class JavaDslModelWriter extends JavaDslModelWriterSupport {
StringBuilder sb = new StringBuilder();
#if( $name == "RouteDefinition" )
writeRoute(sb, def);
+ #elseif( $name == "SwitchDefinition" )
+ writeSwitch(sb, def);
#else
beginStep(sb, "${element}", def);
doWrite${name}(sb, def);
@@ -300,7 +302,9 @@ public class JavaDslModelWriter extends JavaDslModelWriterSupport {
#set( $n = $mojo.lowercase($t) )
#end
#set( $primaryArgs = $mojo.getPrimaryArgs($n, $cl) )
- #if( !$primaryArgs.isEmpty() )
+ #if( $t == "SwitchDefinition" )
+ case "SwitchDefinition" -> writeSwitch(sb, (SwitchDefinition) v);
+ #elseif( !$primaryArgs.isEmpty() )
case "${t}" -> {
${t} _d = (${t}) v;
handledAttributes.clear();
diff --git a/tooling/maven/camel-package-maven-plugin/src/main/resources/velocity/model-yaml-writer.vm b/tooling/maven/camel-package-maven-plugin/src/main/resources/velocity/model-yaml-writer.vm
index 8b3da44d0e4ce..711796bc892a7 100644
--- a/tooling/maven/camel-package-maven-plugin/src/main/resources/velocity/model-yaml-writer.vm
+++ b/tooling/maven/camel-package-maven-plugin/src/main/resources/velocity/model-yaml-writer.vm
@@ -279,6 +279,12 @@ public class YamlModelWriter extends YamlModelWriterSupport {
#if( $name == "RouteDefinition" )
doMoveStepsUnderFrom(jo);
#end
+ #if( $name == "SwitchCaseDefinition" )
+ // Preserve literal strings such as "001" instead of converting them to numbers.
+ if (def.getValue() != null) {
+ jo.put("value", def.getValue());
+ }
+ #end
return jo;
}
#end