Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Converting asynchronous backend service to synchronous request

Not applicable

Hi All,

We have an asynchronous service which needs to be serviced as synchronous API to a front-end application. The service responds with a 201 immediately with a requestId and eventually with actual response on a callbackUrl with the same requestId in response body. The callbackUrl is provided as part of request and be another Apigee endpoint of course. We have a need to make this service synchronous using Apigee. API will make the initial call and

- return an error code if anything other than 201 is received

- if 201 is received with requestId, request will be blocked until a response is received in callbackUrl for that responseId OR a timeout is hit. Delayed callback response will need to be ignored.

I have seen several references in the forum to make service callout asynchronously and later wait for responses. However, I am having hard time finding an API example to achieve what we need.

Thanks in advance, Ashish

0 5 1,977
5 REPLIES 5