Bird
0
0

Which of the following is a common mistake that prevents @Async methods from running asynchronously?

medium📝 Debug Q7 of 15
Spring Boot - Async Processing
Which of the following is a common mistake that prevents @Async methods from running asynchronously?
AUsing @Async on interface methods only.
BAnnotating the class with @Async instead of methods.
CReturning a Future from the async method.
DNot enabling async support with @EnableAsync.
Step-by-Step Solution
Solution:
  1. Step 1: Confirm async support is enabled

    @EnableAsync must be present to activate async processing.
  2. Step 2: Review other options

    @Async on interface methods can work; returning Future is valid; class-level @Async is allowed but method-level is clearer.
  3. Final Answer:

    Not enabling async support with @EnableAsync. -> Option D
  4. Quick Check:

    Missing @EnableAsync disables async processing [OK]
Quick Trick: Always add @EnableAsync to activate async support [OK]
Common Mistakes:
  • Forgetting @EnableAsync
  • Misplacing @Async on interfaces only
  • Thinking Future return blocks async

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Spring Boot Quizzes