FAQ
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

Search Discussions

  • Claus Ibsen at Aug 9, 2011 at 1:21 pm

    On Mon, Aug 8, 2011 at 11:33 AM, Tom Howe 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/

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupusers @
categoriescamel
postedAug 8, '11 at 9:34a
activeAug 9, '11 at 1:21p
posts2
users2
websitecamel.apache.org

2 users in discussion

Claus Ibsen: 1 post Tom Howe: 1 post

People

Translate

site design / logo © 2022 Grokbase