CAMEL-23553: Fix RestRegistry lazy plugin resolution#23336
Merged
Conversation
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>
Contributor
|
🌟 Thank you for your contribution to the Apache Camel project! 🌟 🐫 Apache Camel Committers, please review the following items:
|
Contributor
|
🧪 CI tested the following changed modules:
Build reactor — dependencies compiled but only changed modules were tested (3 modules)
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
RestRegistryis registered as a lazy plugin vialazyAddContextPlugin(), butisContextPluginInUse()always returnsfalsefor lazy plugins. This causedVertxPlatformHttpConsumerandMultiRestConsumerto never resolve the registry — even when camel-rest was on the classpath — breaking contract-first REST services.nullgracefully when camel-rest is absent (instead of throwing), so callers can usePluginHelper.getRestRegistry()directly with a null-check.Changes
SimpleCamelContextresolveBootstrapService()instead of mandatory (returns null when camel-rest absent)AbstractCamelContextcreateRestRegistry()DefaultCamelContextExtensioncreateRestRegistryFactory()DefaultContextPluginManagerVertxPlatformHttpConsumerisContextPluginInUseguard, resolve directlyMultiRestConsumerisContextPluginInUseguard, resolve with null-checkTest plan
mvn test -pl core/camel-base-engine— passesmvn test -pl components/camel-platform-http-vertx— passesmvn test -pl components/camel-webhook— passesClaude Code on behalf of Claus Ibsen
🤖 Generated with Claude Code