Jacques René Mesrine
Jacques René Mesrine

Reputation: 47805

How do I Invoke 3 REST endpoints in parallel?

I have to invoke REST endpoints A, B & C in parallel and combine the resulting JSON from each into one JSON. All REST endpoints reside on different servers.

My initial design calls for 3 Callables executed via FutureTasks. I will then do a Future.get(1000ms) on each FutureTask until they return a value. Is this how you would solve this problem ?

Upvotes: 3

Views: 675

Answers (1)

Don Kirkby
Don Kirkby

Reputation: 56660

That's how I would do it. I really like the Future interface.

Upvotes: 2

Related Questions