You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Tom Howe <to...@artcore.com> on 2011/08/08 11:33:39 UTC

Stopping a route created using @consume

I have a bean that consumes from a queue a bit like this ...

@Component
@Scope(value="session")
public class MyConsumer {

   @Consume(uri = "activemq:myqueue")
   public void process(  @Body String body ) {
   ...
   }

   public void stop() {
    ..how to stop it?...
   }

}


How would I go about implementing a stop() method that stops the route?

Thanks, Tom

Re: Stopping a route created using @consume

Posted by Claus Ibsen <cl...@gmail.com>.
On Mon, Aug 8, 2011 at 11:33 AM, Tom Howe <to...@artcore.com> wrote:
> I have a bean that consumes from a queue a bit like this ...
>
> @Component
> @Scope(value="session")
> public class MyConsumer {
>
>   @Consume(uri = "activemq:myqueue")
>   public void process(  @Body String body ) {
>   ...
>   }
>
>   public void stop() {
>    ..how to stop it?...
>   }
>
> }
>
>
> How would I go about implementing a stop() method that stops the route?
>

Using @Consume does not become a route. Its just a consumer.

There is a JIRA ticket AFAIR to add support for being able to control
the lifecycle.
We may need to add some sort of API / Registry and attribute on
@Consume so you can control this.

Or alternatively allow you to define a routeId on the @Consume to turn
it into a full fledged route. Then it can be fully managed just as the
rest. Maybe that is a better idea?


> Thanks, Tom
>



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