You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Claus Ibsen (JIRA)" <ji...@apache.org> on 2016/07/29 17:29:20 UTC

[jira] [Commented] (CAMEL-10206) Creating a route, while creating a route does not work

    [ https://issues.apache.org/jira/browse/CAMEL-10206?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15399720#comment-15399720 ] 

Claus Ibsen commented on CAMEL-10206:
-------------------------------------

This is not intended behavior. If Camel is starting up, then you should add routes after Camel has been started.

In your custom component you can use a StartupListener to only start new routes when Camel is started
https://github.com/apache/camel/blob/master/camel-core/src/main/java/org/apache/camel/StartupListener.java

And if you receive any messages prior to that you can store those temporary until the startup callback.

> Creating a route, while creating a route does not work
> ------------------------------------------------------
>
>                 Key: CAMEL-10206
>                 URL: https://issues.apache.org/jira/browse/CAMEL-10206
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 2.17.2
>            Reporter: Jens Reimann
>            Priority: Minor
>
> Creating a route while creating a route leaves the second route in line unstarted.
> That sounds a bit strange so I try to explain: When you have a custom camel endpoint which actually forwards requests to another route and does create that route during the "doStart" method then the call stack will be like that:
> * Camel Context - start
> * start routes (set starting = true)
> * Custom Producer/Consumer - doStart 
> * Camel Context - add route
> * start routes -> return due to "starting = true"
> A possible workaround it to create an executor service in the custom component and forward the route creations to it.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)