Breaking News: Grepper is joining You.com. Read the official announcement!
Check it out

How to call Spring Boot Rest API’s Concurrently

Sumit Rawal answered on May 15, 2023 Popularity 1/10 Helpfulness 1/10

Contents


More Related Answers

  • how to implement hateoas in rest spring boot
  • @api operation spring boot
  • develop an api without spring boot
  • Java classes required to call a RESTful Web Service from Java Program using Spring and RestTemplate utility: Read more: https://javarevisited.blogspot.com/2017/02/how-to-consume-json-from-restful-web-services-Spring-RESTTemplate
  • Which Spring Cloud module is used to make a REST API call?
  • How does SpringFox help a developer document REST APIs?
  • Why is Spring Data REST not recommended in real-world applications?
  • Have you exposed a SOAP webservice endpoint using Spring Boot?
  • Can you show the code for an example Get Resource method with Spring REST?
  • What do you understand by Spring Data REST?

  • How to call Spring Boot Rest API’s Concurrently

    0

    In microservices environment it makes sense to make multiple service calls concurrently or rather it sometimes becomes an unavoidable situation where you need to make some calls to multiple services at the same time. Making concurrent calls to services are good ideas because it will reduce the time taken to complete the whole operation rather than sum of time spent over the span of all calls.

    For example, let’s say you make three calls in one service, and let’s further say that all three services can be called in any order. Let’s say each of these services take the time to respond to the client or caller as given below:

    Service Call 1 takes 400ms

    Service Call 2 takes 600ms

    Service Call 3 takes 500ms

    Total time taken by all three services to respond to the caller is 400 + 600 + 500 = 1500 ms. However if you make all three service calls concurrently or at the same time and wait for them to complete, then you have to incur the cost of waiting for the service that takes longest time. In this case, the Service Call 2 takes the longest time to complete and you have to wait maximum of 600 ms.

    Popularity 1/10 Helpfulness 1/10 Language whatever
    Source: Grepper
    Link to this answer
    Share Copy Link
    Contributed on May 15 2023
    Sumit Rawal
    0 Answers  Avg Quality 2/10


    X

    Continue with Google

    By continuing, I agree that I have read and agree to Greppers's Terms of Service and Privacy Policy.
    X
    Grepper Account Login Required

    Oops, You will need to install Grepper and log-in to perform this action.