Expose message queue size and add option to disable monitoring to facilitate testing