Could you add some endpoint like direct (failIfNoConsumers=false), vm, seda or activmq beween the routes that want to sent to your component and the route that consumes your component?
Consuming Endpoints Your Component Endpoint | ----------------------------------------------------------------------------------------------| => Consuming Endpoints (direct,vm,seda,activemq) Your Component Endpoint |-------------------------------------------------|---------------------------------------------| Static route dynamic route Then the message may stay in that endpoint until a consumer will register on the endpoint. Michael > -----Ursprüngliche Nachricht----- > Von: Pascal Schumacher [mailto:pascalschumac...@gmx.net] > Gesendet: Donnerstag, 9. November 2017 10:37 > An: users@camel.apache.org > Betreff: Aw: AW: Spring - Create Bean after Camel Context is started > > Hi Michael, > > thanks for the response. > > Sorry for not making myself clear. The other component accesses multiple > camel routes and throws errors if the routes are not started yet, therefore I > would like spring to start it after the camel context has been started. The > simplifed spring configuration: > > <beans> > <camelContext id="camelContext" /> > <bean id="componentDependingOnStartedCamelContext" depends- > on="camelContext" /> </beans> > > Cheers, > Pascal > > Gesendet: Donnerstag, 09. November 2017 um 07:48 Uhr > Von: "Michael Lück" <michael.lu...@hm-ag.de> > An: users@camel.apache.org > Betreff: AW: Spring - Create Bean after Camel Context is started Hi Pascal, > > perhaps you can encapsulate the call to the bean into a single route builder > and add that route dynamically to the Camel Context like here: > https://stackoverflow.com/questions/10451444/add-camel-route-at- > runtime-in-java > > But I'm not sure if I understood the use case correctly. > > Michael > > > -----Ursprüngliche Nachricht----- > > Von: Pascal Schumacher [mailto:pascalschumac...@gmx.net] > > Gesendet: Mittwoch, 8. November 2017 20:25 > > An: users@camel.apache.org > > Betreff: Spring - Create Bean after Camel Context is started > > > > Hello everybody, > > > > using camel 2.20 with spring 5.0.1 and need to start another component > > (defined as spring bean) after camel context has started. I added > > 'depends- on="camelContextId"' to the other beans spring xml > > definition, but this has a no effect as the camel context is starting > asynchronously. > > > > Any ideas how to solve this? > > > > Thanks and kind regards, > > > > Pascal > >