Request inside request

50 Views Asked by At

I have two systems, which are communicating with each other.

Ideal state:

  1. SystemA makes POST to SystemB
  2. SystemB is processing create action
  3. SystemB needs update data in SystemA thus it makes PUT to SystemA
  4. SystemA updates relevant data
  5. SystemB finishes create action
  6. SystemA receives 200 response

But the problem is, that SystemA is waiting for end of POST action and is not answering to PUT from SystemB. Result is that SystemA is TimedOut and then PUT is processed correctly.

What could be the best and elegant solution? Should I move the POST action to the background job? Should I create new Thread for it?

edit: PUT is made via ActiveResorce and changes attribute of object in SystemA

0

There are 0 best solutions below