Consume asynchronous downstream service : Polling

Hi,

We have a requirement where we need to call asynchronous downstream web services.

1.Submit the GET/POST a request, response may be 200 or 202(with jobId)

2.Use the jobId returned against a another service the retrieve the job status.

3.If the status is done, use the jobId to get the final result. If not, the polling will continue until status of the job is done.

For this we have planned to follow polling functionality in nodejs using npm modules like async-polling.

Is this impacts API or APIGEE environment in anyway? Is there any other approach that you suggest for us to follow?

Thank you,

Mahantesh

Solved Solved
1 3 364
1 ACCEPTED SOLUTION

The approach will work, if you use the hosted functions nodejs capability in Apigee Edge.

I haven't used the module you mentioned within Trireme (the legacy style nodejs hosting in Apigee Edge). It might work, but you'll have better results in the hosted functions capability.

Hosted Functions is still pre-release, but it will allow the use of any nom module.

@Mukundha Madhavan may have more to say.

View solution in original post

3 REPLIES 3

The approach will work, if you use the hosted functions nodejs capability in Apigee Edge.

I haven't used the module you mentioned within Trireme (the legacy style nodejs hosting in Apigee Edge). It might work, but you'll have better results in the hosted functions capability.

Hosted Functions is still pre-release, but it will allow the use of any nom module.

@Mukundha Madhavan may have more to say.

Thank you @Dino.

I am not sure we can wait for hosted functions. I got POC working with this async-polling module as well. Results looks fine to us.

My concern is, is this impact platform in any way in regards to performance? or there is any better way that I can do this?

@Mukundha Madhavan thoughts?

My concern is, is this impact platform in any way in regards to performance?

Sure, there's always an impact. It depends on how often you poll, how heavy the load is on the system. The only way to know for sure is to test it under real-world loads.