Skip to content

Event publication registry entries created for before commit transactional event listeners #726

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
JakeTiritilli opened this issue Jul 11, 2024 · 2 comments
Assignees
Labels
in: event publication registry Event publication registry type: bug Something isn't working
Milestone

Comments

@JakeTiritilli
Copy link

I wanted to see if the Spring Modulith application events behavior is defined for before-commit transactional event listeners (@TransactionalEventListener(phase = TransactionPhase.BEFORE_COMMIT)). From a small test I did, it seems to still add these listeners to the event_publication table but never marks them completed. I'm wondering if that's something that was intentional and what the recommendation would be for a service that needs to make use of both synchronous before-commit transactional event listeners and asynchronous after-commit ones, but would only want the async ones to be written to the event_publication table. Thanks

@odrotbohm odrotbohm self-assigned this Jul 14, 2024
@odrotbohm odrotbohm added in: event publication registry Event publication registry type: bug Something isn't working labels Jul 14, 2024
@odrotbohm
Copy link
Member

Good catch! That's most certainly a bug. We currently create event publication registry entries for all transactional event listeners, when we, of course, should only create them for after commit listeners.

@odrotbohm odrotbohm changed the title Question on the expected application events behavior when the code includes BEFORE_COMMIT transactional event listeners Event publication registry entries created for before commit transactional event listeners Jul 14, 2024
@odrotbohm odrotbohm added this to the 1.3 M1 milestone Jul 14, 2024
@JakeTiritilli
Copy link
Author

Thanks for the quick response and fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: event publication registry Event publication registry type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants