Affects: Spring Boot 2.5.2


Kotlin code:

The following code does not respect "asyncFlatFeedExecutor" param of the @Async annotation when follow method is called on AsyncFlatFeedService bean. However, it is executed asynchronously, but on the default executor.

@Primary
@Service
@Async("asyncFlatFeedExecutor")
class AsyncFlatFeedService : DefaultFlatFeedService()
@Service
class DefaultFlatFeedService {
    override fun follow(follower: Long, following: Long) {
      // async logic is here
    }
}

But if we add override fun follow(follower: Long, following: Long) even w/o annotation to AsyncFlatFeedService, everything works fine.

Comment From: sdeleuze

I guess this DefaultFlatFeedService class extending nothing but overriding follow function is not complete, could you please provide a reproducer (full project attached or related repository URL) to allow us to have a deeper look?

Comment From: yauheniy-mesh

@sdeleuze sorry for the typo, here is the correct version:

@Primary
@Service
@Async("asyncFlatFeedExecutor")
class AsyncFlatFeedService : DefaultFlatFeedService()


@Service
class DefaultFlatFeedService {
    fun follow(follower: Long, following: Long) {
      // async logic is here
    }
}

Comment From: sdeleuze

Hi, I spent some time trying to build a repro, but I can't observe the issue you describe. As asked previously, please provide a full project attached or related repository URL with a description of how you reproduce this issue.

Comment From: spring-projects-issues

If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.

Comment From: spring-projects-issues

Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.