Skip to content

CAMEL-23553: Fix RestRegistry lazy plugin resolution#23336

Merged
davsclaus merged 1 commit into
mainfrom
worktree-more-tui-3
May 20, 2026
Merged

CAMEL-23553: Fix RestRegistry lazy plugin resolution#23336
davsclaus merged 1 commit into
mainfrom
worktree-more-tui-3

Conversation

@davsclaus
Copy link
Copy Markdown
Contributor

Summary

  • RestRegistry is registered as a lazy plugin via lazyAddContextPlugin(), but isContextPluginInUse() always returns false for lazy plugins. This caused VertxPlatformHttpConsumer and MultiRestConsumer to never resolve the registry — even when camel-rest was on the classpath — breaking contract-first REST services.
  • Make the lazy resolution return null gracefully when camel-rest is absent (instead of throwing), so callers can use PluginHelper.getRestRegistry() directly with a null-check.

Changes

File Change
SimpleCamelContext Use optional resolveBootstrapService() instead of mandatory (returns null when camel-rest absent)
AbstractCamelContext Null-check factory in createRestRegistry()
DefaultCamelContextExtension Handle null from createRestRegistryFactory()
DefaultContextPluginManager Remove entry when lazy supplier returns null (avoids repeated retries)
VertxPlatformHttpConsumer Drop broken isContextPluginInUse guard, resolve directly
MultiRestConsumer Drop broken isContextPluginInUse guard, resolve with null-check

Test plan

  • mvn test -pl core/camel-base-engine — passes
  • mvn test -pl components/camel-platform-http-vertx — passes
  • mvn test -pl components/camel-webhook — passes
  • Test contract-first REST DSL with camel-platform-http-vertx to verify services are registered in RestRegistry

Claude Code on behalf of Claus Ibsen

🤖 Generated with Claude Code

RestRegistry is registered as a lazy plugin but isContextPluginInUse()
always returns false for lazy plugins, so VertxPlatformHttpConsumer
and MultiRestConsumer never resolved the registry even when camel-rest
was on the classpath.

Make the lazy resolution return null gracefully when camel-rest is
absent instead of throwing, so callers can use PluginHelper.getRestRegistry()
directly with a null-check.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions
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
Copy link
Copy Markdown
Contributor

🧪 CI tested the following changed modules:

  • components/camel-platform-http-vertx
  • components/camel-webhook
  • core/camel-base-engine

ℹ️ Dependent modules were not tested because the total number of affected modules exceeded the threshold (50). Use the test-dependents label to force testing all dependents.

Build reactor — dependencies compiled but only changed modules were tested (3 modules)
  • Camel :: Base Engine
  • Camel :: Platform HTTP :: Vert.x
  • Camel :: Webhook

⚙️ View full build and test results

@davsclaus davsclaus merged commit 4836cf8 into main May 20, 2026
6 checks passed
@davsclaus davsclaus deleted the worktree-more-tui-3 branch May 20, 2026 05:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant