public void start()
{
- if (registry.getListenerContainer(id).isChildRunning())
+ if (running())
throw new IllegalStateException("Consumer instance " + id + " is already running!");
- log.info("{} - Starting ListenerContainer", id);
+ log.info("{} - Starting - consumed {} messages before", id, consumed);
errorHandler.clearState();
registry.getListenerContainer(id).start();
}
public void stop()
{
- if (!registry.getListenerContainer(id).isChildRunning())
+ if (running())
throw new IllegalStateException("Consumer instance " + id + " is not running!");
- log.info("{} - Stopping ListenerContainer", id);
+ log.info("{} - Stopping", id);
registry.getListenerContainer(id).stop();
- log.info("{} - Stopped", id);
+ log.info("{} - Stopped - consumed {} messages so far", id, consumed);
}
public boolean running()