@cezarcruz
These two approaches have approximately the same performance.
Though there might be a problem if you have too many listeners called on BEFORE_COMMIT phase. As long as they act synchronously, it can impact the transaction running time.
Anyway, it's not the end of the world. You can make your listeners run asynchronously
@ComponentpublicclassListener{@TransactionalEventListener(phase=AFTER_COMMIT)@AsyncvoidcaptureEvent(SomeEventevent){// do stuff}}
But not all listeners should be run asynchronously. For example, email sender is a perfect candidate. Whilst the one that stores archive records is not.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
First time I see that, and looks amazing. There is some performance drawback?
@cezarcruz
These two approaches have approximately the same performance.
Though there might be a problem if you have too many listeners called on
BEFORE_COMMIT
phase. As long as they act synchronously, it can impact the transaction running time.Anyway, it's not the end of the world. You can make your listeners run asynchronously
But not all listeners should be run asynchronously. For example, email sender is a perfect candidate. Whilst the one that stores archive records is not.