Hi.

We're updating Spring Boot from 3.3 to 3.4.

I found a deprecation warning that we forgot to handle with the 3.0 upgrade: ListenableFuture. We are not using this directly, but overriding ThreadPoolTaskExecutor's submitListenable method. I don't see any deprecation warning on the ThreadPoolTaskExecutor class, nor it's functions that uses ListenableFuture. It is also implementing AsyncListenableTaskExecutor that is also deprecated. From this I guess this class should be also deprecated.

My goal is now to replace this ThreadPoolTaskExecutor with a close equivalent. Though I didn't found yet what I'm looking for.

Comment From: bclozel

AsyncListenableTaskExecutor itself is deprecated and has been removed in #33809. As of Spring Framework 7.0, ThreadPoolTaskExecutor doesn't implement this interface anymore but still exists.

The migration path in your case would be to use one of the other submit methods instead and stop using ListenableFuture completely.

Comment From: jhoeller

Indeed, ThreadPoolTaskExecutor is not deprecated, just the ListenableFuture-based methods (as inherited from AsyncListenableTaskExecutor) are deprecated along with the ListenableFuture type itself. We recommend staying with the same executor, just switching to the submitCompletable method based on CompletableFuture for task submission purposes.

If you are overriding ListenableFuture-based methods in a custom executor subclass, feel free to keep doing so for the time being. Only as of 7.0, those methods and the ListenableFuture type itself are going to be removed, at which point you'll have to remove your overriding methods as well.