sumedha
sumedha

Reputation: 489

Request Respone Model / Sync/Async /Event Driven

I have requirement i will have to act as middleware system , upstream system makes call to him and i will make a call to third party system with some extra addons . Once i submit request to third party system they give me an id as reponse . I will have to use this id to make another call to get the status of my request , once the status of my request state changes to say done , i will have to invoke one more service to get the details of my request.Once i get response only then i will have to add some extra info to it and send the details back to upstream system.

For this scenario which model will be better Request/ Response ( Synchronous) Asynchronous call Event driven machanism

The flow between my system and third party system is fixed that part cannot be changed. Upstream system is going to invoke my service through ESB. I am planning to use RestFul please let me know your inpusts on this.

Upvotes: 1

Views: 63

Answers (1)

alexander.polomodov
alexander.polomodov

Reputation: 5534

You can simply use same scheme for your middleware system as using third party system:

Once i submit request to third party system they give me an id as reponse . I will have to use this id to make another call to get the status of my request , once the status of my request state changes to say done

  • So your middleware should return Middleware RequestId on each Upstream request.
  • Upstream can check request status for this Middleware RequestId
  • When request status changes to done upstream can get response.

I create this sequence diagram to demonstrate this simple interaction of Upstream, MiddleWare and Thirdparty systems:

enter image description here

Upvotes: 1

Related Questions