We are using Spring AMQP library to consume messages from Queues in RabbitMQ. Our publisher produces variable number of messages on known schedules, So we are thinking about start Consumers to on schedule and stop once Queue is empty.
I am wondering how to gracefully close channel and connetion when Queue length reaches Zero?