Logic for MQ broker