1,462 questions
0
votes
0
answers
63
views
Thread issue while sending records to kafka using completable future
@Async("kafkaTaskExecutor")
@Override
@Retryable(value = {Exception.class}, maxAttemptsExpression = "${kafka.save.failure.retry.maxAttempts}",
backoff = @Backoff(...
4
votes
2
answers
165
views
thenCompose hangs/timeout web graphql application
I have SpringBoot 3, graph ql web app. My goal is to resolve one field which depends on several dataloaders. The problem is that when I combine them using thenCompose my application just hangs for ...
0
votes
0
answers
16
views
bootstrap.coonect doesn't resolve the future unless I pass a FullHttpRequest in netty
I am new to netty and I am stuck at a point. I am using netty as a reverse proxy and here is my channel pipeline.
streamChannel.pipeline()
.addLast(new ...
0
votes
0
answers
33
views
CompletableFuture.whenComplete() with transactional method calling not working
I have a class in my spring boot 3 application that sends a Kafka message and updates the notification status and report after the message is sent:
public class SomeSender {
KafkaTemplate<?, ?&...
-1
votes
1
answer
38
views
AWS sdk 2 does not return from ".join()" that is called on the completable future on PutObject when uploading large files
We upgraded from version 1 to the version 2 sdk because support was cut for the first version of the SDK.
The old client sync client was switched out for the new async client and new transfer manager. ...
3
votes
1
answer
173
views
Does CompletableFuture ensure field update visibility after join() in Java?
I’m working with CompletableFuture in Java and want to understand how field updates made inside a CompletableFuture task are visible to the main thread after calling join(). Specifically, if I pass an ...
1
vote
0
answers
82
views
Managing ThreadPool and Connection Pool sizes with CompletableFuture for concurrent third-party API calls
I'm working on implementing concurrent third-party API calls for items in a list using CompletableFuture in Java. Instead of processing these requests sequentially, I want them to be executed ...
1
vote
0
answers
111
views
java.util.concurrent.CompletionException: org.springframework.beans.factory.support.ScopeNotActiveException
Trying to execute below piece of code but getting an error as stated follows. Any suggestions to fix this? Source code
CompletableFuture[] futures = stringList.stream().map(stringListRef -> ...
1
vote
1
answer
42
views
CompletableFuture not using defined TaskExecutor. Using commonPool instead
I'm trying execute some async work using CompletableFuture with a custom Executor. However, I see from the logs that it's using the default commonPool. What am I missing here?
@Async("...
0
votes
1
answer
86
views
How to partition a list and send requests in parallel
I would like to partition a list into a sublists, and send a request for each sublist in parallel.
I have a list of product ids, want to partition it to be sublists with the size of 3.
List<List<...
0
votes
0
answers
55
views
How to convert a CompletableFuture to a synchronous Flux stream
I'm using BedRock AI SDK of Java, the stream function is this:
default CompletableFuture<Void> converseStream(Consumer<ConverseStreamRequest.Builder> converseStreamRequest, ...
0
votes
0
answers
40
views
Is my non-blocking POST request retry logic using CompletableFuture overcomplicated?
I am implementing a non-blocking retry logic for a POST request in Java using CompletableFuture. The goal is to retry the request up to n times and return the final result (either success or failure) ...
3
votes
0
answers
152
views
Why does canceling a CompletableFuture not actually interrupt the underlying task? [duplicate]
Here's a simple example:
public static void main(String[] args) throws Exception {
ExecutorService executorService = Executors.newCachedThreadPool();
CompletableFuture<Void> callbackHook ...
1
vote
1
answer
107
views
Interrupting a thread that's running a CompletableFuture [duplicate]
Consider I have an ExecutorService operating on top of a pool of daemon threads (so that I don't need to explicitly shut it down):
final var executor = Executors.newFixedThreadPool(
Runtime....
0
votes
0
answers
20
views
Java ForkJoinPool thread pool will inexplicably terminate running [duplicate]
Why does my code inexplicably interrupt execution when I use ForkJoinPool's default thread pool, but I don't encounter this problem when I use ExecutorService's custom thread pool
Default ForkJoinPool ...