The "messages_ready" and "messages_unacknowledged" were read from the wrong element, as a result it was always reported as zero.