Keep processing the message queue until empty