|
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