luigidemasi opened a new pull request, #27079: URL: https://github.com/apache/camel/pull/27079
# Description Add a Switch EIP that evaluates a selector once per entry and uses a literal lookup table to choose one fixed endpoint. Scalar cases match strings case-insensitively; an optional fallback handles null or unmatched results. Selector failures use normal Camel error handling. This draft also includes the proposed composite form: an expression returns a map, `keys` selects its fields, and each case declares a complete combination of named literals. This lets a semantic batch such as `refs:department,urgent` select a destination directly, while keeping core routing independent of semantic evaluation. Java, XML and YAML DSLs, startup validation, tracing/JMX, and generated metadata are included. @davsclaus, this provides the code, tests and examples for the design discussion in [CAMEL-24988](https://issues.apache.org/jira/browse/CAMEL-24988), following [the request for concrete material](https://issues.apache.org/jira/browse/CAMEL-24988?focusedCommentId=18120696#comment-18120696). The composite form, its syntax, and its string/boolean/number comparison rules are proposals for evaluation. Domain declarations and exhaustiveness checking are outside this changeset. The AsciiDoc page contains equivalent Java, XML and YAML examples, inputs, expected destinations, semantic question setup and destination routes: - [Scalar routing from a header](https://github.com/luigidemasi/camel/blob/c8419d2eb0215cf7607e726dc661e3405d7bc47f/core/camel-core-engine/src/main/docs/modules/eips/pages/switch-eip.adoc#_route_from_a_header) - [Composite routing from a map in a header](https://github.com/luigidemasi/camel/blob/c8419d2eb0215cf7607e726dc661e3405d7bc47f/core/camel-core-engine/src/main/docs/modules/eips/pages/switch-eip.adoc#_route_from_a_map_in_a_header) - [Routing from a semantic batch](https://github.com/luigidemasi/camel/blob/c8419d2eb0215cf7607e726dc661e3405d7bc47f/core/camel-core-engine/src/main/docs/modules/eips/pages/switch-eip.adoc#_route_from_a_semantic_batch) ## Validation - Implementation commit: 177 focused tests passed across core routing, management, Java export, XML DSL, Spring JAXB, YAML DSL, and semantic integration. - Implementation commit: full 695-module reactor passed with `mvn -B -ntp -DskipTests -Dmaven.build.cache.enabled=false install`. - Documentation update: compiled and executed the extracted examples in all three DSLs; 45 routing checks passed across nine examples. Semantic routing used a deterministic adapter, without remote inference. - Regenerated the catalog documentation and JBang documentation samples; the sample generator validated 346 samples. Documentation cross-reference checks and `git diff --check` passed. # Target - [x] Targets `apache/camel:main`. # Tracking - [x] Tracked by [CAMEL-24988](https://issues.apache.org/jira/browse/CAMEL-24988). # Apache Camel coding standards and style - [x] Commits have meaningful subjects and descriptions. - [x] Full root reactor build passed with tests skipped, as described above; generated changes are committed. Formatting and import sorting ran during implementation validation. # AI-assisted contributions - [x] Commits include AI co-authorship, cryptographic signatures and Signed-off-by trailers. _Generated by Codex via /oss-fix-issue on behalf of @luigidemasi._ -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
