← Quiz: Spring AOP and Proxies: all 10 questions
Quiz: Spring AOP and Proxies · Question 6 of 10
Method a() calls b() in the same bean; b() has @Async. The controller calls a(). Does b() run asynchronously?
Method a() calls b() in the same bean; b() has @Async. The controller calls a(). Does b() run asynchronously?
- A.Yes, always
- B.No, because the call to b() is on this, not on the proxy
- C.Only if a() is also @Async
- D.Only on Java 21 or later
Answer & explanation
Correct answer: No, because the call to b() is on this, not on the proxy
Self-invocation skips the proxy, so the @Async advice never runs for that call.
Can you get the rest right without peeking?
Take the timed Quiz: Spring AOP and Proxies quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →