Class asyncresttemplate is Spring's central class for asynchronous client-side HTTP access.
Questions tagged [asyncresttemplate]
29 questions
19
votes
4 answers
How to use Spring WebClient to make multiple calls simultaneously?
I want to execute 3 calls simultaneously and process the results once they're all done.
I know this can be achieved using AsyncRestTemplate as it is mentioned here How to use AsyncRestTemplate to make multiple calls simultaneously?
However,…

ddzz
- 259
- 1
- 3
- 10
11
votes
1 answer
Request by restTemplate to Netty Server hangs the thread
RestTemplate example is below.
public class SimpleClient {
private final String URL;
private AsyncRestTemplate rest = new AsyncRestTemplate(new Netty4ClientHttpRequestFactory());
private RestTemplate restTemplate = new…

Gurkan İlleez
- 1,503
- 1
- 10
- 12
10
votes
3 answers
How can we make asynchronous REST api call in Java?
I am using Spring RestTemplate and want to make a call to another service that doesn't return any response body. So, I don't want to wait for the response. So, it's just fire and forget, and continue with the remaining code. I am thinking of…

user10937286
- 321
- 1
- 3
- 10
10
votes
3 answers
Make API multiple times with AsyncRestTemplate and wait for all to complete
I have to make Rest API invocation using RestTemplate multiple time with different parameters. API is same but it is the parameter that is getting changed. Number of times is also variable. I want to use AsyncRestTemplate but my main Thread should…

TV Nath
- 499
- 5
- 12
- 35
8
votes
1 answer
Calling Async REST api from spring batch processor
I wrote a spring batch job that processes List of Lists.
Reader returns List of List.
Processor works on each ListItem and returns processed List.
Writer writes stuff to DB and sftp from List of List.
I have a use case where I call Async REST api…

Mia
- 169
- 1
- 2
- 11
6
votes
1 answer
Blocking on ListenableFuture with timeout
I'm using Spring 4.2.3 AsyncRestTemplate.exchange() to call some API that will take several seconds, and i'm expecting that listenableFuture.get(1, TimeUnit.SECONDS) will block for 1 second and then throw TimeOutException.
What happens instead is…

Yoni
- 375
- 3
- 19
3
votes
0 answers
Difference between calling rest client asynchronously with webclient and @Async
I am planning to call an web rest endpoint asynchronously. Should i use webclient for all asynchronous invocation. OR can i use rest template and annotate the method with @Async. Will it still be invoked asynchronously.
Wats the differnce between…

VIJ
- 1,516
- 1
- 18
- 34
3
votes
2 answers
Should I make my REST client API library Async (Java 8)
I am creating client libraries for our REST server. For the C# library I use HttpClient.PostAsync() which works great, it returns an object that the caller can just wait on (making it synchronous), they can complete some other actions and then wait,…

David Thielen
- 28,723
- 34
- 119
- 193
3
votes
2 answers
Spring's AsyncRestTemplate not working with zipped content, Getting compressed content instead of json object
I have enabled content compression on my spring boot app and response of every API is getting compressed but if I hit those APIS using RestTemplate I get content like…

Naresh Joshi
- 4,188
- 35
- 45
2
votes
1 answer
How to Verify the hsotnameverifyer using ssl pinning in android using Resttemplate
I'm doing a banking application for interacting client and server for secure purpose using HTTPs for that I have to add SSL pinning in android using rest template. I checked many links for restemplate code, but it's not working properly. Is this…

siddhi
- 21
- 4
2
votes
2 answers
Wait for some Spring ListenableFuture
There is a service which uses Spring AsyncRestTemplate for sending rest calls. Each call of AsyncRestTemplate.exchange() returns ListenableFuture. Something like this:
ListenableFuture future1 = new AsyncRestTemplate().exchange(...);
…

biven
- 132
- 3
- 9
1
vote
1 answer
Is RestTemplate compatible with Spring Boot 3?
I'm trying to upgrade a legacy application to spring boot 3 and RestTemplate is used extesibly.
As far as I know Spring Boot 3 doesn't allow blocking code (at least by default) and I was wondering if this behavior could be changed or the only…
user18876695
1
vote
1 answer
How to call Async API in Spring Boot using RestTemplate?
I am in a need of calling a api asynchronously in my spring boot application? Is there any methods that we can used in Spring RestTemplate?

Gautham Sharma
- 25
- 5
1
vote
0 answers
I need to get a value of ListenableFutureCallback from the delete function of asyncresttemplate
I have a problem getting an object from ListenableFutureCallback when I use delete function of AsyncRestTemplate. This is my source code:
ListenableFutureCallback

Carlos
- 11
- 2
1
vote
1 answer
Spring AsyncRestTemplate connection pool and thread pool settings
I want to use AsyncRestTemplate for making a REST call in my service. According to Spring documentation, this class has 5 constructors( refer…

user3740951
- 1,109
- 2
- 20
- 39