You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by gilboy <jo...@gmail.com> on 2012/06/13 21:52:38 UTC

Camel Lifecycle question

Hi

I have a custom endpoint which has both a consumer and a producer. 

When a new instance of the endpoint and its producer and consumer is created
I want to perform a particular action.

I am trying to determine if there is any callback method on the endpoint,
consumer and producer which might indicate this state has been reached. From
debugging through the code I see the doStart() methods invoked in the
following flow:

(1) Endpoint.doStart()
(2) Producer.doStart()
(3) Consumer.doStart()

Hence, I am thinking I could invoke the action in the Consumer.doStart()
method.

Am I guaranteed that the Consumer.doStart() will always be invoked after the
Producer.doStart()?

Thanks
Joe

--
View this message in context: http://camel.465427.n5.nabble.com/Camel-Lifecycle-question-tp5714458.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel Lifecycle question

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

See this page
http://camel.apache.org/lifecycle.html

When Camel starts a route, it starts the
components/endpoints/producers/services first.
And the route consumer itself afterwards. So that is why you see that given
order.

But a person can manually create a consumer from the endpoint, and start
that, before
he/she creates a producer and starts that. So there is no guarantee. It
depends on the use-case.


On Wed, Jun 13, 2012 at 9:52 PM, gilboy <jo...@gmail.com> wrote:

> Hi
>
> I have a custom endpoint which has both a consumer and a producer.
>
> When a new instance of the endpoint and its producer and consumer is
> created
> I want to perform a particular action.
>
> I am trying to determine if there is any callback method on the endpoint,
> consumer and producer which might indicate this state has been reached.
> From
> debugging through the code I see the doStart() methods invoked in the
> following flow:
>
> (1) Endpoint.doStart()
> (2) Producer.doStart()
> (3) Consumer.doStart()
>
> Hence, I am thinking I could invoke the action in the Consumer.doStart()
> method.
>
> Am I guaranteed that the Consumer.doStart() will always be invoked after
> the
> Producer.doStart()?
>
> Thanks
> Joe
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Camel-Lifecycle-question-tp5714458.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen