All Questions
480 questions
0
votes
0
answers
110
views
How asynchrony works in Spring Framework?
How to asynchronously execute this method? I read on the Internet and it says that by default Spring is not asynchronous. But I noticed a strange feature: when testing this endpoint using Postman with ...
-1
votes
1
answer
65
views
Failing JWT Authentication in spring with async requests
Hello everyone I wrote an api Backend in Spring and added jwt Authentication. The problem is that I wrote everything async and now the Authentication doesnt work with the async methodes. The token is ...
0
votes
0
answers
40
views
Will Async HTTP request resolve server timeout?
I've got server A that sends request to server B using CloseableHttpClient's execute method.
When server B proceeds with the request it tries to send request to server A(before returning the response) ...
0
votes
0
answers
160
views
Why CompletableFuture don't call API in Spring boot?
I'm making multiple API calls at the same time with CompletableFuture to reduce user waiting time.
Here is my code:
@Async
public CompletableFuture<CommonDataDTO> commonData() throws ...
0
votes
1
answer
62
views
How to prevent array cleared from @Async Method argument in Spring Boot?
I am experiencing some sort of thread issue with the @Async method annotation. Am processing data from csv to DB, for every 10000 record pass these records to another method annotated with @Async. ...
2
votes
1
answer
357
views
Spring @Async architecture for scheduled, long running api calls
I need to solve the following problem, described exemplary:
My Spring application checks every minute if there is a new job. If there is a job, it subtasks should be run in parallel. They are mostly ...
-1
votes
1
answer
92
views
Spring Boot Asynchronous Controller via Callable not working
I want to make an endpoint that is asynchronous with Spring Boot.
I want to avoid Futures and thus @Async because it forces the use of futures.
I read and applied the code from this article : https://...
0
votes
1
answer
128
views
Ensuring Variable Accessibility in Asynchronous Method Chains
In the following code snippet:
void method1(String variable1) {
String variable2 = "something";
String variable3 = getValue3();
service.asyncMethod1().thenAcceptAsync(result -&...
2
votes
0
answers
204
views
Is it OK to block the thread started by @Scheduled in Spring WebFlux?
When you use @Scheduled annotation on a method in Spring WebFlux, it is executed on a thread called something like "scheduled-1". Can you use blocking APIs on such threads? Or do you still ...
4
votes
2
answers
785
views
Why do I get NoSuchFileException when using multipartFile @Async in java spring boot?
I can use multipartFile.getInputStream() with the scanner without using @Async, but when I get the file with the multipartFile.getInputStream() stream , it says the file path incorrectly(with @Async).
...
0
votes
0
answers
240
views
Cannot Return CompletableFuture<ResponseEntity> From Spring POST Request
I am trying to return ResponseEntity from a post request after doing an asyncronous operation on spring boot server. This is simplified version of what i am doing:
@POST
@Consumes({ MediaType....
-1
votes
2
answers
955
views
How to resolve getting Timeout java.lang.IllegalStateException: Timeout on blocking read for 5000000000 NANOSECONDS
I want to write a async api that return 202 Accepted after getting a request. Then after that it should send n Post request per second for halt-time seconds. This is my attempt at the problem.
@...
0
votes
1
answer
254
views
spring-Integration - http inbound-gateway response and asynchronous processing - task executor threads just processing one message instead of all
Description:
We have a Spring Integration flow where we want to have an endpoint configured, split the payload, return to the consumer i.e. with a http code 202 and the other items must continue to be ...
0
votes
2
answers
3k
views
Handling exceptions thrown by Spring @Async methods
In my Spring Boot app, I have a method that sends emails by making (blocking) HTTP calls to the SendGrid API. In some cases I call this method several times per request, so in order to mitigate the ...
0
votes
0
answers
83
views
How to throw exception in main thread when CompletableFuture finished exceptionally immediately
When my service is called, I have 2 @Async FeignClient APIs getBookAsync, getAuthorAsync to check things:
@Async
public CompletableFuture<JsonNode> getBookAsync(Long id) {
CompletableFuture&...