camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tommy Chheng <tommy.chh...@gmail.com>
Subject Re: amazon sqs route shutting down?
Date Wed, 02 Mar 2011 16:46:47 GMT
Thanks Claus, extending the MainSupport does fix the problem

-- 
@tommychheng
http://tommy.chheng.com

On Wednesday, March 2, 2011 at 8:22 AM, Claus Ibsen wrote: 
> See the Main class in camel-spring and/or camel-core.
> 
> 
> 
> 
> On Wed, Mar 2, 2011 at 5:20 PM, Tommy Chheng <tommy.chheng@gmail.com> wrote:
> > I want to define a route to poll from an amazon SQS queue.
> > val context = new DefaultCamelContext(reg)
> > context.setHandleFault(true)
> > context.addRoutes(new RouteBuilder{
> > override def configure(){
> > from("aws-sqs://test_development?amazonSQSClient=#test_sqs").to("log:b")
> > }}
> > )
> > context.start
> > where test_sqs is in the registry for an AmazonSQSClient(credentials) object
> > 
> > It seems to connect fine but when I run it(using mvn exec:java -Dexec.mainClass),
but it shutsdown immediately after.
> > 
> > DefaultCamelContext Route: route1 started and consuming from: Endpoint[aws-sqs://test_development?amazonSQSClient=%23test_sqs]
> > 
> > How can I prevent the process from immediately shuting down? I want the process
to run to continously poll the SQS queue.
> > 
> > If I replace the aws-sqs queue with a local activemq, the camel application runs
successfully until issued a shutdown command.
> > context.addComponent("activemq", ActiveMQComponent.activeMQComponent(Config.activeMqConnection))
> > from("activemq:queue:a").to("log:b")
> > 
> > 
> > --
> > @tommychheng
> > http://tommy.chheng.com
> 
> 
> 
> -- 
> Claus Ibsen
> -----------------
> FuseSource
> Email: cibsen@fusesource.com
> Web: http://fusesource.com
> Twitter: davsclaus
> Blog: http://davsclaus.blogspot.com/
> Author of Camel in Action: http://www.manning.com/ibsen/
> 

Mime
  • Unnamed multipart/alternative (inline, 8-Bit, 0 bytes)
View raw message