davsclaus opened a new pull request, #23336:
URL: https://github.com/apache/camel/pull/23336

   ## 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
   
   - [x] `mvn test -pl core/camel-base-engine` — passes
   - [x] `mvn test -pl components/camel-platform-http-vertx` — passes
   - [x] `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](https://claude.com/claude-code)


-- 
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]

Reply via email to