Claus Ibsen created CAMEL-27953:
-----------------------------------

             Summary: camel-flowable: outbound channel ignores a user flowable 
consumer, channel errors lose their cause
                 Key: CAMEL-27953
                 URL: https://issues.apache.org/jira/browse/CAMEL-27953
             Project: Camel
          Issue Type: Bug
            Reporter: Claus Ibsen
             Fix For: 4.25.0


Found while improving the option descriptions of camel-flowable for CAMEL-23832 
(pull request https://github.com/apache/camel/pull/31196).
These are separate problems of the component; the descriptions change only 
documents the current behavior.

h4. 1. A route that consumes from flowable:<key> gets no events
{{CamelChannelModelProcessor.createOutboundEventChannelAdapter}} always creates 
a new FlowableEndpoint and registers it with camelContext.addEndpoint, which 
replaces (and stops) an endpoint with the same URI, then adds its own route 
from that endpoint to the destination of the channel. A user consumer started 
before the deployment stays on the replaced endpoint and receives nothing; one 
started after it fails with "Consumer already defined" 
(FlowableEndpoint.addConsumer). When the channel has no destination, no adapter 
is set at all.
Proposed change: reuse an existing FlowableEndpoint and its consumer when the 
channel has no destination, or document that outbound events only go to the 
destination of the channel.

h4. 2. Channel deployment errors lose their cause
{{CamelChannelModelProcessor.processInboundDefinition}} and 
createOutboundEventChannelAdapter throw new FlowableException("Error creating 
...") without the caught exception, so the reason (for example a wrong 
sourceUri or destination URI) is lost.
Proposed change: pass the cause: new FlowableException("...", e).

h4. 3. Smaller issues
CamelChannelModelProcessor wraps the new FlowableEndpoint in 
try-with-resources, so the endpoint is closed right after it is registered 
(harmless today as DefaultEndpoint.doStop does nothing). The endpoint URI is 
"flowable:" + channel key without the tenant, so channel models with the same 
key in two tenants share one endpoint (not checked end to end). The doc page 
says both producer and consumer are supported, which only holds for the 
consumer the component creates itself.


_Claude Code on behalf of davsclaus_



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to