Skip to content

Support an asynchronous API for RestTemplate [SPR-8804] #13446

Closed

Description

@spring-projects-issues

Mike Youngstrom opened SPR-8804 and commented

Asynchronous programming models are growing in popularity. To support this model of development it would be great if RestTemplate were enhanced to support an asynchronous model.

JAX-RS's client api is currently slated to add an asynchronous mode.

There are several Async Http client libraries.

It would seem that soon would be the right time to add Async support for RestTemplate.


Referenced from: commits 296e218, ebcee26, 20c4177, 38c8c6d

12 votes, 19 watchers

Activity

  1. spring-projects-issues commented on Nov 1, 2011

    @spring-projects-issues
    CollaboratorAuthor

    Chris Beams commented

    Thanks for the submission, Mike. I've added Juergen, Arjen and others as watchers on this issue and slated it for the 3.2 backlog. Agreed that 3.2 is likely the right time to consider such functionality; I'll be interested to see what other users have to say about this as well. Use cases would be helpful to ensure we're all on the same page.

  2. spring-projects-issues commented on Mar 8, 2012

    @spring-projects-issues
    CollaboratorAuthor

    Lukas Krecan commented

    We have similar need. Our use case is simple. We are creating an aggregated resource. We need to call several underlying REST APIs and when all of the results return, we merge them to return aggregated result. We want to execute all the requests in parallel. So the ideal API would be

    Future result1 = execute(...);
    Future result2 = execute(...);
    Future result3 = execute(...);
    
    merge(result1, result2, result3);
    
  3. spring-projects-issues commented on Mar 8, 2012

    @spring-projects-issues
    CollaboratorAuthor

    Chris Beams commented

    Added @Rossen as a watcher as well as he's currently investigating async options in 3.2

  4. spring-projects-issues commented on Oct 3, 2012

    @spring-projects-issues
    CollaboratorAuthor

    Lukas Krecan commented

    I have written a quick prototype of AsyncRestTemplate lukas-krecan@1f55c1b. Basically it wraps RestTemplate, executes the corresponding method using AsyncTaskExecutor and returns Future instead of the original return value. Please let me know what you think about it. If you are interested, I will fix the documentation, formating, tests and other stuff and will issue a pull request.

  5. spring-projects-issues commented on Oct 4, 2012

    @spring-projects-issues
    CollaboratorAuthor

    Rossen Stoyanchev commented

    Yes, that will certainly be one part of the implementation. We'll also want to support HTTP libraries that provide non-blocking support like Appache HttpComponents HttpAsyncClient.

  6. spring-projects-issues commented on Apr 22, 2013

    @spring-projects-issues
    CollaboratorAuthor

    Lukas Krecan commented

    Do you have any update whether it will make it to Spring 4?

  7. spring-projects-issues commented on Jul 4, 2013

    @spring-projects-issues
    CollaboratorAuthor

    Arjen Poutsma commented

    It will make it :).

  8. spring-projects-issues commented on Aug 15, 2013

    @spring-projects-issues
    CollaboratorAuthor

    Arjen Poutsma commented

    Pull request at #336

  9. spring-projects-issues commented on Oct 15, 2013

    @spring-projects-issues
    CollaboratorAuthor
  10. added
    type: enhancement
    in: core
    has: votes-jira
    in: web
    on Jan 11, 2019
  11. added this to the 4.0 M3 milestone on Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

has: votes-jirain: corein: webtype: enhancement

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions