A less hacky solution to the problem, using an RPC call to ensure the messages are enqueued and processed timely.