In this post, we will see how to resolve How to execute operations for a batch of elements in ArrayList with CompletableFuture? Question: Java version : 11 I have List of objects, I want to perform certain operations on them, ...

In this post, we will see how to resolve Is CompletableFuture is must use return type for AAsync spring boot annotation? Question: I want to Use @Async annotation on method for running it asynchronously. I have defined my ThreadExecutor as ...

In this post, we will see how to resolve How to sequence a task to execute once all Single’s in a collection complete Question: I am using Helidon DBClient transactions and have found myself in a situation where I end ...

In this post, we will see how to resolve Ways to cancel downstream tasks in CompletableFuture chain when exception fired? Question: My database methods return a CompletableFuture to do the work with database asynchronously and then process the result on ...

In this post, we will see how to resolve How do I optionally chain another independent CompletableFuture if the first condition doesn’t pass? Question: I have a method like this: I would like to return a method that first matches ...

In this post, we will see how to resolve Spring JPA Async Save Question: I’m trying to save a large List (+100K items) created from an XLS file with the CrudRepository.saveAll() method. Because of data size, the saveAll method takes ...

Question: Let’s say that in Java I have a method doSomethingAsync(input) that schedules some work via an executor service and returns a CompletableFuture<FooBar>. Let’s say that I have a billion (or whatever huge number of distinct inputs). And let’s say ...

Question: I have this code: So in focusService.findMine i’m dependent on the result from applicationUserService.findByUserName(getCurrentApplicationUserName()) But in my frontend tests all data is displayed in the right way and manner. I´ve read about thenCompose method on CompletableFuture so i tested ...

Question: I have a Stream of CompletableFuture of SomeObject and I’m trying to filter this on some attribute of SomeObject and I can’t seem to find a satisfying way to filter this. I tried this, but I’m wondering if there ...

Question: As an example, I have a supplier that might take time to run: * sneaky is just a utility to convert to runtime exception. I’d like to be able to do something like this: I also have a partial ...