Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bug #58763 [Messenger][RateLimiter] fix additional message handled wh…
…en using a rate limiter (Jean-Beru) This PR was merged into the 6.4 branch. Discussion ---------- [Messenger][RateLimiter] fix additional message handled when using a rate limiter | Q | A | ------------- | --- | Branch? | 6.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Issues | Fix #57230 | License | MIT Fix additional message handled by Messenger when using a rate limiter. A token was reserved but not consumed. See #57230 With the following configuration: ```yaml framework: rate_limiter: test: policy: 'fixed_window' limit: 1 interval: '10 seconds' messenger: transports: test: dsn: '%env(MESSENGER_TRANSPORT_DSN)%' rate_limiter: 'test' routing: 'App\Messenger\DoSomething': 'test' ``` Log generated by the MessageHandler: ```bash $ bin/console messenger:consume test [OK] Consuming messages from transport "test". // The worker will automatically exit once it has received a stop signal via the messenger:stop-workers command. // Quit the worker with CONTROL-C. // Re-run the command with a -vv option to see logs about consumed messages. 09:13:48 WARNING [app] Message handled 09:13:58 WARNING [app] Message handled 09:13:58 WARNING [app] Message handled # Duplicated 09:14:08 WARNING [app] Message handled 09:14:08 WARNING [app] Message handled # Duplicated 09:14:18 WARNING [app] Message handled 09:14:18 WARNING [app] Message handled # Duplicated ``` After fix: ```bash bin/console messenger:consume test [OK] Consuming messages from transport "test". // The worker will automatically exit once it has received a stop signal via the messenger:stop-workers command. // Quit the worker with CONTROL-C. // Re-run the command with a -vv option to see logs about consumed messages. 09:18:54 WARNING [app] Message handled 09:19:04 WARNING [app] Message handled 09:19:14 WARNING [app] Message handled 09:19:24 WARNING [app] Message handled ``` Commits ------- ec1b999b812 [Messenger][RateLimiter] fix additional message handled when using a rate limiter
- Loading branch information