Generalize getting the message queue size