Skip to main content

All Questions

Tagged with
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 ...
Steffano Aravico's user avatar
-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 ...
Luca Roverati's user avatar
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) ...
user27424299's user avatar
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 ...
Nguyen Andrew's user avatar
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. ...
Yugesh's user avatar
  • 4,092
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 ...
Maltram's user avatar
  • 49
-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://...
Genku's user avatar
  • 39
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 -&...
witek's user avatar
  • 351
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 ...
Amirhossein's user avatar
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). ...
workwithlife's user avatar
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....
lastpeony4's user avatar
-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. @...
denisssj's user avatar
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 ...
ste's user avatar
  • 3
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 ...
Dónal's user avatar
  • 188k
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&...
vunhatchuong's user avatar

15 30 50 per page
1
2 3 4 5
32