Visitar URL original
CAMEL-25429: camel-jbang - camel overview lists the error handling apart from the flows by davsclaus · Pull Request #27563 · apache/camel · GitHub
Skip to content

CAMEL-25429: camel-jbang - camel overview lists the error handling apart from the flows - #27563

Merged
davsclaus merged 1 commit into
mainfrom
feature/CAMEL-25429-overview-errors
Oct 8, 2026
Merged

davsclaus merged 1 commit into
mainfrom
feature/CAMEL-25429-overview-errors

Conversation

@davsclaus

Copy link
Copy Markdown
Contributor

https://issues.apache.org/jira/browse/CAMEL-25429 (the camel overview part; independent of #27557 / #27560, which are the runtime topology and the monitor)

camel overview (and the camel-summary.md it writes) listed a global error handler as a route calling the error route, under Flows between routes:

- `error-handler@error-handling.camel.yaml:3` calls `parked` over `direct:parked`
- `error-handler@error-handling.camel.yaml:12` calls `parked` over `direct:parked`
- `checkout` calls `payment-provider` over `direct:charge`

Now, on fail-well/error-handling:

## Flows between routes

- `checkout` calls `payment-provider` over `direct:charge`

## Error handling

- dead letter channel (global, error-handling.camel.yaml:3): failures to `parked`
- onException IllegalStateException (global, error-handling.camel.yaml:12): failures to `parked`
- no error handler in `payment-provider`: failures go back to the caller, whose error handling acts
  • Flows keep the calls only. A link from a global error handler, or sent while handling a failure (onException, doCatch, dead letter channel), is not a flow.
  • Error handling:
    • each global handler by what it is: dead letter channel, onException with its exception classes, route configuration. The YAML, XML and Java readers label it;
    • a route's own error handling, as `route` (its own error handling);
    • the routes the failures go to;
    • the routes with noErrorHandler.
  • The source readers record a route's own error handler: ProjectRoutes.Route gets an errorHandler component through withErrorHandler, and the existing constructors are kept. YAML reads errorHandler: noErrorHandler: {} in a route; Java reads .errorHandler(noErrorHandler()) / a dead letter channel.
  • The plain-text form of the overview (what the AI reads) has the same split.

Tests: IntegrationSummaryTest.errorHandlingIsNotAFlow (YAML) and errorHandlingIsNotAFlowInJava. The overview, summary and capabilities tests pass.

🤖 Generated with Claude Code

https://claude.ai/code/session_01STT6whBgK1AqsSsUKrnE8m

@github-actions

github-actions Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

🌟 Thank you for your contribution to the Apache Camel project! 🌟
🤖 CI automation will test this PR automatically.

🐫 Apache Camel Committers, please review the following items:

  • First-time contributors require MANUAL approval for the GitHub Actions to run
  • You can use the command /component-test (camel-)component-name1 (camel-)component-name2.. to request a test from the test bot although they are normally detected and executed by CI.
  • You can label PRs using skip-tests and test-dependents to fine-tune the checks executed by this PR.
  • Build and test logs are available in the summary page. Only Apache Camel committers have access to the summary.

⚠️ Be careful when sharing logs. Review their contents before sharing them publicly.

@github-actions github-actions Bot added the dsl label Oct 8, 2026
@github-actions

github-actions Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

🧪 CI tested the following changed modules:

  • dsl/camel-jbang/camel-jbang-core

🔬 Scalpel shadow comparison — Scalpel: 6 of 701 tested, 8 compile-only — current: 6 all tested

Maveniverse Scalpel detected 6 affected modules (current approach: 6).

Skip-tests mode would test 6 modules (1 direct + 6 downstream), skip tests for 8 (generated code, meta-modules)

Modules Scalpel would test (6)
  • camel-jbang-mcp ← downstream of org.apache.camel:camel-jbang-core
  • camel-jbang-plugin-mcp ← downstream of org.apache.camel:camel-jbang-core
  • camel-jbang-plugin-route-parser ← downstream of org.apache.camel:camel-jbang-core
  • camel-jbang-plugin-tui ← downstream of org.apache.camel:camel-jbang-core
  • camel-jbang-plugin-validate ← downstream of org.apache.camel:camel-jbang-core
  • camel-launcher-container ← downstream of org.apache.camel:camel-launcher
Modules with tests skipped (8)
  • camel-jbang-it
  • camel-jbang-main
  • camel-jbang-plugin-edit
  • camel-jbang-plugin-generate
  • camel-jbang-plugin-kubernetes
  • camel-jbang-plugin-test
  • camel-launcher
  • coverage

ℹ️ Shadow mode — Scalpel observes but does not affect test execution. Learn more

⚠️ Some tests are disabled on GitHub Actions (@DisabledIfSystemProperty(named = "ci.env.name")) and require manual verification:

  • dsl/camel-jbang/camel-jbang-core: 2 test(s) disabled on GitHub Actions

💡 Manual integration tests recommended:

You modified dsl/camel-jbang/camel-jbang-core. The related integration tests in dsl/camel-jbang/camel-jbang-it are excluded from CI. Consider running them manually:

mvn verify -f dsl/camel-jbang/camel-jbang-it -Djbang-it-test
All tested modules (15 modules, 2m 42s total)

Total reactor time: 2m 42s

Module Duration Status
Camel :: Launcher 53.5s SUCCESS
Camel :: JBang :: MCP 41.9s SUCCESS
Camel :: JBang :: Plugin :: Validate 20.9s SUCCESS
Camel :: JBang :: Plugin :: Kubernetes 20.5s SUCCESS
Camel :: JBang :: Plugin :: Testing 10.9s SUCCESS
Camel :: Coverage 5.3s SUCCESS
Camel :: JBang :: Plugin :: Generate 1.7s SUCCESS
Camel :: JBang :: Plugin :: Edit 1.6s SUCCESS
Camel :: JBang :: Plugin :: MCP 1.6s SUCCESS
Camel :: JBang :: Plugin :: Route Parser 1.2s SUCCESS
Camel :: JBang :: Integration tests 1.2s SUCCESS
Camel :: JBang :: Main 1.2s SUCCESS
Camel :: Launcher :: Container 0.8s SUCCESS
Camel :: JBang :: Core n/a
Camel :: JBang :: Plugin :: TUI n/a

Top 20 slowest modules:

  • Camel :: Launcher (53.5s)
  • Camel :: JBang :: MCP (41.9s)
  • Camel :: JBang :: Plugin :: Validate (20.9s)
  • Camel :: JBang :: Plugin :: Kubernetes (20.5s)
  • Camel :: JBang :: Plugin :: Testing (10.9s)
  • Camel :: Coverage (5.3s)
  • Camel :: JBang :: Plugin :: Generate (1.7s)
  • Camel :: JBang :: Plugin :: Edit (1.6s)
  • Camel :: JBang :: Plugin :: MCP (1.6s)
  • Camel :: JBang :: Plugin :: Route Parser (1.2s)
  • Camel :: JBang :: Integration tests (1.2s)
  • Camel :: JBang :: Main (1.2s)
  • Camel :: Launcher :: Container (0.8s)

⚙️ View full build and test results

@gnodet-bot gnodet-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 Code Review

One gap spotted in the new route-level error-handler detection logic.

This review was generated by an AI agent, Hermès on behalf of @gnodet.

Comment on lines +159 to +165
if (r.isErrorHandlerFactorySet()) {
ErrorHandlerFactory eh = r.getErrorHandlerFactory();
if (eh instanceof NoErrorHandlerDefinition) {
route = route.withErrorHandler("noErrorHandler");
} else if (eh instanceof DeadLetterChannelDefinition) {
route = route.withErrorHandler("deadLetterChannel");
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Missing else branch — defaultErrorHandler() and ref-based handlers are silently ignored

The current code only handles two subtypes of ErrorHandlerFactory. If a route overrides with errorHandler(defaultErrorHandler()) or errorHandlerRef("myHandler"), the factory is set but the branch falls through — leaving route.errorHandler as null, making it look like the route inherits the global handler.

This means a route that explicitly resets to the default error handler (overriding a global DLC, for example) will be incorrectly reported in the overview.

Suggested fix:

Suggested change
if (r.isErrorHandlerFactorySet()) {
ErrorHandlerFactory eh = r.getErrorHandlerFactory();
if (eh instanceof NoErrorHandlerDefinition) {
route = route.withErrorHandler("noErrorHandler");
} else if (eh instanceof DeadLetterChannelDefinition) {
route = route.withErrorHandler("deadLetterChannel");
}
// the route's own error handler, such as errorHandler(noErrorHandler())
if (r.isErrorHandlerFactorySet()) {
ErrorHandlerFactory eh = r.getErrorHandlerFactory();
if (eh instanceof NoErrorHandlerDefinition) {
route = route.withErrorHandler("noErrorHandler");
} else if (eh instanceof DeadLetterChannelDefinition) {
route = route.withErrorHandler("deadLetterChannel");
} else {
route = route.withErrorHandler("defaultErrorHandler");
}
}

The else branch catches DefaultErrorHandlerDefinition and any ref-based handler (both of which are semantically equivalent to "using the default" in terms of the overview display).

@apupier

apupier commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

to rebase on main when #27570 is merged

…art from the flows

camel overview listed a global error handler as a route that calls the
error route, such as "error-handler@routes.camel.yaml:3 calls parked",
under Flows between routes. The flows now hold the calls only, and a new
Error handling section lists each global handler by what it is (dead
letter channel, onException with its exceptions, route configuration)
and where it is written, a route's own error handling, the routes the
failures go to, and the routes with no error handler, whose failures go
back to the caller. The same split is in the plain text the AI reads.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01STT6whBgK1AqsSsUKrnE8m
@davsclaus
davsclaus force-pushed the feature/CAMEL-25429-overview-errors branch from 687354d to c70be6d Compare October 8, 2026 12:56
@davsclaus
davsclaus merged commit ba4901c into main Oct 8, 2026
5 checks passed
@github-actions
github-actions Bot deleted the feature/CAMEL-25429-overview-errors branch October 8, 2026 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants