Spring: application events are synchronous and join the caller's transaction

publishEvent() is a method call, not a queue. The listener runs on the publisher's thread, inside the publisher's transaction - so a slow listener slows the request, and a failing one rolls back the caller's work.

Full code & output

This topic is available to PRO members.

Sign in Create a free account

Run this yourself in the Online Java Compiler, spin up a live REST API in the API Sandbox, or practise with Java interview questions.

Published 2026-08-25