-
Notifications
You must be signed in to change notification settings - Fork 230
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
When using reactive sagas, duplicate message detector causes consumer to crash on a duplicate #101
Comments
Sorry for the delayed reply. |
We're using Aurora Postgres. The error in database is: 'duplicate key value violates unique constraint "received_messages_pkey"'. It kind of seems like there might be an outer transaction that might be messing with something? Not sure how this could be though because this code is ran before any application code. Here's some of the stacktrace with personal information removed (I tried to include most important bits, but with the reactive stack it's kind of hard to distinguish them):
|
This is because the doWithMessage() method inside ReactiveSqlTableBasedDuplicateMessageDetector class runs inside a transaction:
The duplicate exception handling is done correctly in the isDuplicate() method, but the Mono in doWithMessage() will fail because transactional manager will throw an PessimisticLockingFailureException. Adding onErrorResume (DataAccessException...) to this mono as well should fix the issue.
The text was updated successfully, but these errors were encountered: