IBX-11974: Replaced backported message deduplication with Symfony native implementation and lock release listener - #24
Merged
bnowak merged 2 commits intoJul 24, 2026
Conversation
bnowak
marked this pull request as ready for review
July 22, 2026 11:34
konradoboza
approved these changes
Jul 22, 2026
barw4
approved these changes
Jul 22, 2026
alongosz
approved these changes
Jul 22, 2026
Steveb-p
approved these changes
Jul 24, 2026
…ive implementation and lock release listener
bnowak
force-pushed
the
IBX-11974-replaced-backported-message-deduplication-with-Symfony-native-implementation
branch
from
July 24, 2026 08:26
a4fd6f1 to
17d9d0e
Compare
bnowak
deleted the
IBX-11974-replaced-backported-message-deduplication-with-Symfony-native-implementation
branch
July 24, 2026 08:29
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Related PRs:
Description:
Replaces the bundle's own backported message deduplication with Symfony's native implementation, now that the required pieces ship in Symfony 7.4:
DeduplicateMiddleware,DeduplicateStamp(contracts),DeduplicateStampNormalizerandLockKeyNormalizerin favour ofSymfony\Component\Messenger\Middleware\DeduplicateMiddleware,Symfony\Component\Messenger\Stamp\DeduplicateStampandSymfony\Component\Lock\Serializer\LockKeyNormalizer.configureLockNormalizerBackport()workaround; the nativeLockKeyNormalizeris wired directly.ReleaseDeduplicationLockOnFailureListener, a backport of Symfony 8.1's listener, so the deduplication lock is released once a failed message will no longer be retried — otherwise a new dispatch of the same key stays blocked until the lock TTL expires. It is deliberately wired to the bundle'sibexa.messenger.lock_factory(not Symfony's defaultlock.factory) so it releases locks stored in theibexa_messenger_lock_keystable. The backport class and its DI fallback are marked@todofor removal once the minimum Symfony version is>= 8.1.symfony/lockas an explicit dependency and updated the PHPStan baseline and tests accordingly.For QA:
Requires
deduplication_lock_storageto be enabled.DeduplicateStampkey results in only one being handled while the lock is held.deduplication_lock_storagedisabled, no deduplication middleware or failure listener is registered and behaviour is unchanged.Documentation:
No client-facing configuration changes —
deduplication_lock_storageworks exactly as before. Developer-facing upgrade note for 6.0: the deduplication stamp moves fromIbexa\Contracts\Messenger\Stamp\DeduplicateStampto Symfony's nativeSymfony\Component\Messenger\Stamp\DeduplicateStamp; code attaching the stamp must switch to the Symfony class.I think that is also worth mentioning somewhere in docs (during upgrading to version 6.0), that all messages stored in
ibexa_messenger_messagesshould be processed before or removed manually. Some stamps/messages format/contract could be changed between versions and won't work on 6.0, so starting with 6.0 ibexa version this table should be empty to ensure correct processing of background messages.