Replaced onPublish call back with getMessage and FIFO buffer