jeudi 15 août 2019

Web apps integration with event based services

I am looking for a best practise when connecting a web application (a React single page app for example) with pure event based backend (microservices, ActiveMQ for example).

When I do a GET call from React (which is request response), how do I get the response considering all backend services are event based?

My thoughts are:

  1. Execute the GET command
  2. Have a REST controller service in the backend (request-response) which fires an event and returns back a response that everything went ok
  3. On the client side, the signal is caught, but nothing happens, just keep loading
  4. Event is processed meanwhile in the backend, which fires another "response" event when done, to which (using stickiness or similar approach) the same REST controller listens
  5. The controller sends the actual response to the browser, using websockets (or similar)
  6. Browser gets the response, display the results

I know there are workarounds, but I am looking for the best event-based solution.




Aucun commentaire:

Enregistrer un commentaire