we are using @RabbitListener to listen to the queue and when there are messages we process them. However I want to do some reporting task when queue is empty, this happens when our app just processed tons of messages in the queue and no more message for a while. that's the time I want to report. How can i do that with @RabbitListener?
here is my code:
@RabbitListener(queues = "${consumer.queue}", containerFactory = "ListenerContainerFactory")
public void handleMessage(Message message) {
processEvent(message);
}