Claus Ibsen created CAMEL-27610:
-----------------------------------

             Summary: camel-spring: a spring-event component not created by 
SpringCamelContext gets no events
                 Key: CAMEL-27610
                 URL: https://issues.apache.org/jira/browse/CAMEL-27610
             Project: Camel
          Issue Type: Bug
          Components: camel-spring
            Reporter: Claus Ibsen
             Fix For: 4.24.0


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

h4. 1. A spring-event component that SpringCamelContext did not create receives 
no events
{{EventComponent}} does not implement {{ApplicationListener}}. Only 
{{SpringCamelContext.onApplicationEvent()}} passes events on, and only to the 
{{eventComponent}} field that {{SpringCamelContext.doBuild()}} sets. 
{{doBuild()}} creates that component only when no {{spring-event}} component is 
registered yet ({{hasComponent("spring-event") == null}}).
So a {{spring-event}} component that is added before the context is built, for 
example a hand-made {{EventComponent}}, is used for the endpoints but never 
gets an event. Its consumers start without an error and receive nothing.
Proposed change: let {{SpringCamelContext}} pass the events to the registered 
{{spring-event}} component when it is an {{EventComponent}}, or fail at startup 
when the component cannot receive events.

_Claude Code on behalf of davsclaus_



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

Reply via email to