Spring @Async annotation on interface methods
I quickly tested it and having @Async
on an interface will make implementation asynchronous.
If you want to try it yourself: You can easily test this by checking that the values of Thread.currentThread().getId()
are different (before calling the method and inside the method) or just adding a Thread.sleep(10000);
in the method expected to be asynchronous.
Also take note the return type must be void
or java.util.concurrent.Future
.