I am developing a microservice architecture where the API publishes a message through RabbitMQ. One or more consumers will read the message, preform its functions then if successful acknowledge the message. These functions can take many seconds and is not preformed by the API Gateway and is instead "ran in the background". What are the possibilities for updating the user interface that the functions are completed?
One idea I have is the consumer workers publish a "finished" message that a web socket server consumes and pushes to the user interface the function is complete. One problem I see with this is if the functions finishes before the user interface subscribes to the web socket the user interface will not update. Second issue I see is there needs to be a way to listen to specific event id and only consume those ids where the end user is needing. I don't believe rabbitMQ other than one time topics can achieve this.
Am I missing something when it comes to event sourcing and interacting with the user interface? What way is most efficient to update the user interface when the functions/events are completed?
Thank you for the help.