[ISSUE-9500] Fix transaction message check service offset advancement… #9523
+343
−128
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Background
Transactional message checks in TransactionalMessageServiceImpl.check() occasionally threw uncaught exceptions.
When that happened, the broker did not advance the consume offsets of the half (RMQ_SYS_TRANS_HALF_TOPIC) and op (RMQ_SYS_TRANS_OP_HALF_TOPIC) queues.
As a result, the same half message was pulled and re-checked indefinitely, causing:
High broker CPU usage
Repeated WARN logs for the identical message
Potential message-check backlog growth (visible in monitoring)
The behaviour was reported in Issue #9500 as an “infinite loop while checking transactional messages”.
This prevents the infinite loop where the same half message gets checked repeatedly due to offset not advancing when exceptions occur during transaction check.
Checklist
Fixes Issue #9500
Unit tests added/updated
No breaking API changes
Logged enough context for future debugging
Please review, thanks!
Which Issue(s) This PR Fixes
Fixes #issue_id
Brief Description
How Did You Test This Change?