0

I have 3 software components of a Web Application: 1. JS-client application 1 (JSApp1) 2. Java Spring (REST and Websockets) server app (SRV) 3. JS-client application 2 (JSApp2)

My current task is to send some data from JSApp1, save them in the SRV DB and respond to JSApp1 telling whether the operation was successful or not. I'm using usual HTTP Post request for that. But for saving this data the SRV needs to ask JSApp2 for the permission. I use websockets for that purpose. Having done that I would miss connection to the JSApp1 because web sockets are not synchronous at all.

Is there any workaround to this issue? I mean keeping HTTP POST request to do a send/receive operation using websockets or anything else.

Thanks in advance.

  • I have a question : are you sure in your context that there will always be someone in your JSApp2 logged on to confirm the data ? Otherwise I would go for a classic stuff like creating a simple workflow where a data has to be "validated" before being pushed into the right place. Otherwise you can check long pulling where you can wait for JSApp2 confirmation before finishing your pull. But usually your start to run into troubles with timeouts at 30s or 60s of waiting and tyring to increase those timeouts might be cumbersome (apache in frontend need also increase timeout, proxies,...) – Walfrat Jan 31 at 15:15
  • Thanks for the comment. JSApp2's yes/no answer depends on its user input. – Andrii Jan 31 at 15:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.