You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by lpezet <lp...@gmail.com> on 2012/08/28 18:11:25 UTC

autoStartup and Endpoints

Hello!

If I'm reading the documentation correctly, *autoStartup* is to allow the
context or route to start automatically or not when Camel/Spring starts.

However, regardless of that setting, a *ScheduledPollEndpoint.doStart()* is
called.
Should we consider endpoints as part of a route? If so, "You can use the
autoStartup option to configure if a given route should be started when
Camel starts" is a little wrong in the logical sense.

My case is that I want to test a (spring) camel route with AWS-S3 from and
to endpoints. But first, before any Camel thing starts, I need to setup my
AmazonS3 mock expectations (using EasyMock). The S3Endpoint uses AmazonS3 to
check if the bucket exists on *doStart()*.
I wasn't expecting it to do so, since I explicitly specified
autoStartup=false (for the camel context AND the route itself).

Should doStart() be called on scheduled enpoints? Or is the AWS-S3
implementation is little buggy (e.g. it needs to check if the context has
started or not)?

Thanks!
Luc.



--
View this message in context: http://camel.465427.n5.nabble.com/autoStartup-and-Endpoints-tp5718204.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: autoStartup and Endpoints

Posted by Charles Moulliard <ch...@gmail.com>.
You should consider to use http://camel.apache.org/routepolicy.html to
define when (= if the Amazon S3 conditions matches) and how we could
start/stop Apache Camel routes

On Tue, Aug 28, 2012 at 6:11 PM, lpezet <lp...@gmail.com> wrote:

> Hello!
>
> If I'm reading the documentation correctly, *autoStartup* is to allow the
> context or route to start automatically or not when Camel/Spring starts.
>
> However, regardless of that setting, a *ScheduledPollEndpoint.doStart()* is
> called.
> Should we consider endpoints as part of a route? If so, "You can use the
> autoStartup option to configure if a given route should be started when
> Camel starts" is a little wrong in the logical sense.
>
> My case is that I want to test a (spring) camel route with AWS-S3 from and
> to endpoints. But first, before any Camel thing starts, I need to setup my
> AmazonS3 mock expectations (using EasyMock). The S3Endpoint uses AmazonS3
> to
> check if the bucket exists on *doStart()*.
> I wasn't expecting it to do so, since I explicitly specified
> autoStartup=false (for the camel context AND the route itself).
>
> Should doStart() be called on scheduled enpoints? Or is the AWS-S3
> implementation is little buggy (e.g. it needs to check if the context has
> started or not)?
>
> Thanks!
> Luc.
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/autoStartup-and-Endpoints-tp5718204.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Charles Moulliard
Apache Committer / Sr. Pr. Consultant at FuseSource.com
Twitter : @cmoulliard
Blog : http://cmoulliard.blogspot.com

Re: autoStartup and Endpoints

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

I have logged a ticket to improve this
https://issues.apache.org/jira/browse/CAMEL-5695

I agree we should look into not start the route services up front, but
defer to when the route is actually started.
The trick is that we need to enlist the route in JMX and as well do
some sanity validation of the route up front.



On Tue, Aug 28, 2012 at 6:11 PM, lpezet <lp...@gmail.com> wrote:
> Hello!
>
> If I'm reading the documentation correctly, *autoStartup* is to allow the
> context or route to start automatically or not when Camel/Spring starts.
>
> However, regardless of that setting, a *ScheduledPollEndpoint.doStart()* is
> called.
> Should we consider endpoints as part of a route? If so, "You can use the
> autoStartup option to configure if a given route should be started when
> Camel starts" is a little wrong in the logical sense.
>
> My case is that I want to test a (spring) camel route with AWS-S3 from and
> to endpoints. But first, before any Camel thing starts, I need to setup my
> AmazonS3 mock expectations (using EasyMock). The S3Endpoint uses AmazonS3 to
> check if the bucket exists on *doStart()*.
> I wasn't expecting it to do so, since I explicitly specified
> autoStartup=false (for the camel context AND the route itself).
>
> Should doStart() be called on scheduled enpoints? Or is the AWS-S3
> implementation is little buggy (e.g. it needs to check if the context has
> started or not)?
>
> Thanks!
> Luc.
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/autoStartup-and-Endpoints-tp5718204.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cibsen@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen