Skip to content

Tag: asynchronous

Does Spring AMQP CorrelationData getFuture wait indefinitely without timeout?

In the context of Publisher confirms, when waiting for the CorrelationData’s future (SettableListenableFuture#get()) – does it wait indefinitely or is there a timeout configured under the water? Answer It does wait indefinitely. There is just no any opinion and everything is delegated directly to the java.util.concurrent.FutureTask internally in the org.springframework.util.concurrent.SettableListenableFuture implementation. Not sure why the question, but in normal situation

Asynchronous execution/operation with CompletableFuture in Java 8+

In Java, is calling get() method while looping on CompletableFuture instances as good as doing synchronous operations although CompletableFuture is used for async calls? Answer ‘get()’ waits until the future is completed. If that’s what you want, it’s what you use. There’s no general rule. For example, you might be using a method that is inherently asynchronous, but in your

Asynchronous inserts to cassandra with save order of inserts per key

I have an ordered set of incoming events and I need to insert them into Cassandra. I want to take advantage of the speed of asynchronous inserts, but my incoming events may have duplicates by key of target table. If I understand correctly, then asynchronous insertions can’t guarantee data consistency in this case, since asynchronous executions imply the program order

How to have an asynchronous and non-concurrent scheduler in Spring?

I have in the main class that starts the app: and a scheduler I want to prevent the scheduler from being launched again if the internal process takes more than 15 minutes to start the task again. I can’t find the way. I have tried implementing @DisallowConcurrentExecution with the quartz library but it is still concurrent. Any ideas? Answer I’ve