davsclaus opened a new pull request, #28895: URL: https://github.com/apache/camel/pull/28895
Fixes [CAMEL-26118](https://issues.apache.org/jira/browse/CAMEL-26118). ### 1. A producer to a channel that is not deployed yet fails every send with a NullPointerException **What was wrong:** when a route with `to("flowable:myChannel")` starts before the channel model is deployed, `FlowableComponent.createEndpoint` creates a bare `FlowableEndpoint` with only the channel key. Its producer has no inbound channel model and no `EventRegistryEngineConfiguration`, so `FlowableProducer.process` threw a `NullPointerException` on every send. This stayed so after the channel was deployed: `CamelChannelModelProcessor` then registers a new endpoint under the same URI, but the running producer still holds the nulls. **What changed:** when the producer has no channel or configuration, it looks up the endpoint registered in the `CamelContext` under its URI. Once the channel is deployed, that is the endpoint the channel model processor registered, and the producer sends with its channel and configuration. While no inbound channel with that key is deployed, the send fails with a `FlowableException`: `No inbound channel with key myChannel is deployed in the Flowable Event Registry, so flowable:myChannel cannot send the event`. Producers created after deployment keep the old path (no lookup). `FlowableEndpoint` gets getters for the inbound channel and the configuration (the setters were there already). **Tests:** `FlowableProducerChannelNotDeployedTest` starts a route to `flowable:userRouteChannel` before the channel is deployed (new channel `userRouteChannel.channel`, without a `sourceUri`): - a send before deployment fails with the `FlowableException` naming the key; - a send after deployment starts the process with the event's variables. Both failed before the fix with the `NullPointerException`; both pass now. Module suite: 7 tests, 0 failures. ### 2. The doc gave the URI format as flowable-event:// **What changed:** the URI format in `flowable-component.adoc` is now `flowable:channelKey[?options]`. A short "Sending to a channel that is not deployed yet" section describes the behaviour above. ### Notes - The catalog copy of the doc is regenerated. No options or headers changed, so no other generated files changed. - No upgrade guide entry: the old behaviour was a `NullPointerException` on every send. - Not changed: the producer looks the endpoint up on every send only while its own channel is null, so a producer created after deployment is not affected. Redeploying a channel that a running producer already holds is out of scope here. _Claude Code on behalf of Claus Ibsen (davsclaus)_ 🤖 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]
