René's URL Explorer Experiment


Title: fix: keep RabbitMQ delay queues per priority and publish before rejecting by gr8man · Pull Request #107 · codeigniter4/queue · GitHub

Open Graph Title: fix: keep RabbitMQ delay queues per priority and publish before rejecting by gr8man · Pull Request #107 · codeigniter4/queue

X Title: fix: keep RabbitMQ delay queues per priority and publish before rejecting by gr8man · Pull Request #107 · codeigniter4/queue

Description: Description Delayed delivery in RabbitMQHandler (push() with a delay and later()) had three problems. A single delay queue was shared by every priority. queue_{queue}_delay was declared once with x-dead-letter-routing-key fixed to the default priority routing key ({queue}.default). A delayed job with a non-default priority was dead-lettered into the default bucket after its TTL, so priority ordering was lost. In addition, a second process declaring the same argument set differently received PRECONDITION_FAILED (406) and lost its channel. later() rejected the original message before the replacement was published. basic_nack() was called before publishDelayedMessage(). If the publish failed, the original message was already gone — a silently lost job. publishDelayedMessage() relied on the exchange already existing and re-bound the delay queue on every publish. later() can be called by a worker that never went through push(), so the exchange (and its bindings) might not exist at that point. In addition, push() only reset $this->priority/$this->delay on the success path, so a failed push could leak state into the next operation. Changes src/Handlers/RabbitMQHandler.php Delay queues are now created per logical queue and priority: queue_{queue}_{priority}_delay (getDelayQueueName($queue, $priority)). The x-dead-letter-routing-key therefore always targets the priority bucket the job belongs to. The legacy queue_{queue}_delay name is kept only for cleanup (getLegacyDelayQueueName()). later() publishes the delayed copy first and only then calls basic_nack() on the original message. If publishing throws, the original message stays unacknowledged and is not lost. publishDelayedMessage() now ensures the exchange exists (declareExchange()), declares and binds the per-priority delay queue only once (guarded by $this->declaredQueues). declareExchange() binds the priority queues together with the exchange declaration instead of re-binding them on every publish. clearQueue() purges the delay queue of every priority (before the priority queues) and also purges the legacy delay queue, so jobs scheduled before this change cannot leak back after a clear. push() resets priority and delay in a finally block so the state can never leak into the next push. Testing Added tests/RabbitMQHandlerUnitTest.php, which exercises the handler logic without a live broker (channel and config are mocked): testGetDelayQueueNameIncludesPriority() testPublishDelayedMessageDeclaresPerPriorityQueueAndDeadLetterRouting() — asserts that x-dead-letter-routing-key matches the priority bucket. testPublishDelayedMessageBindsDelayQueueOnlyOnceAcrossPublications() testLaterPublishesDelayedMessageBeforeRejectingOriginalMessage() — asserts the publish/basic_nack ordering. testLaterDoesNotRejectOriginalMessageWhenPublishingDelayedFails() testClearQueuePurgesDelayQueuesForEachPriority() — including the legacy delay queue. testPushResetsPriorityAndDelayInFinallyBlockOnFailure() The existing tests/RabbitMQHandlerTest.php and tests/RabbitMQDelayTest.php suites still pass against the integration setup. Verified locally on PHP 8.5 with PHPUnit 11.5: phpunit ....... OK (237 tests, 682 assertions, 27 skipped) phpstan ....... [OK] No errors psalm ......... No errors found php-cs-fixer .. 0 of 76 files would be fixed

Open Graph Description: Description Delayed delivery in RabbitMQHandler (push() with a delay and later()) had three problems. A single delay queue was shared by every priority. queue_{queue}_delay was declared once with ...

X Description: Description Delayed delivery in RabbitMQHandler (push() with a delay and later()) had three problems. A single delay queue was shared by every priority. queue_{queue}_delay was declared once with ...

Opengraph URL: https://github.com/codeigniter4/queue/pull/107

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:f7e40b29-84e6-a52a-0487-6bab28426d3f
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idE610:1BB1CE:1B669B:253B09:6AFD4F29
html-safe-noncec1dcf602c2c68bfc388315ba268cc7b2ef8a8c86a80d1fb407aee6bf3d649647
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNjEwOjFCQjFDRToxQjY2OUI6MjUzQjA5OjZBRkQ0RjI5IiwidmlzaXRvcl9pZCI6IjcyNDczMzE4NTAwMzk2NzY3MTMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac26bd18ff001a970a8073f75a09ed7a9b50b976c056405db2470ed4cd061ad380
hovercard-subject-tagpull_request:5251084996
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/codeigniter4/queue/pull/107/files
twitter:imagehttps://avatars.githubusercontent.com/u/5325117?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/5325117?s=400&v=4
og:image:altDescription Delayed delivery in RabbitMQHandler (push() with a delay and later()) had three problems. A single delay queue was shared by every priority. queue_{queue}_delay was declared once with ...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None66653c2e55a6fff2930be1bdf07ee4f8aa137e3956d056c822563be6f878755e
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/codeigniter4/queue git https://github.com/codeigniter4/queue.git
octolytics-dimension-user_id44521256
octolytics-dimension-user_logincodeigniter4
octolytics-dimension-repository_id704648363
octolytics-dimension-repository_nwocodeigniter4/queue
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id704648363
octolytics-dimension-repository_network_root_nwocodeigniter4/queue
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releaseb6f01f7cb9f35f8c09949773241a3d49dd04b340
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/codeigniter4/queue/pull/107/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fcodeigniter4%2Fqueue%2Fpull%2F107%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fcodeigniter4%2Fqueue%2Fpull%2F107%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=codeigniter4%2Fqueue
Reloadhttps://github.com/codeigniter4/queue/pull/107/files
Reloadhttps://github.com/codeigniter4/queue/pull/107/files
Reloadhttps://github.com/codeigniter4/queue/pull/107/files
codeigniter4https://github.com/codeigniter4
queuehttps://github.com/codeigniter4/queue
Codehttps://github.com/codeigniter4/queue
Issues2 (2)https://github.com/codeigniter4/queue/issues
Pull requests5 (5)https://github.com/codeigniter4/queue/pulls
Actionshttps://github.com/codeigniter4/queue/actions
Projectshttps://github.com/codeigniter4/queue/projects
Security and qualityhttps://github.com/codeigniter4/queue/security
Insightshttps://github.com/codeigniter4/queue/insights
Sign up for GitHub https://github.com/signup?return_to=%2Fcodeigniter4%2Fqueue%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fcodeigniter4%2Fqueue%2Fissues%2Fnew%2Fchoose
gr8manhttps://github.com/gr8man
codeigniter4:develophttps://github.com/codeigniter4/queue/tree/develop
gr8man:fix/rabbitmq-delays-and-later-reschedulehttps://github.com/gr8man/queue/tree/fix/rabbitmq-delays-and-later-reschedule
Conversation 0 https://github.com/codeigniter4/queue/pull/107
Commits 3 https://github.com/codeigniter4/queue/pull/107/commits
Checks 20 https://github.com/codeigniter4/queue/pull/107/checks
Files changed https://github.com/codeigniter4/queue/pull/107/files
Please reload this pagehttps://github.com/codeigniter4/queue/pull/107/files
fix: keep RabbitMQ delay queues per priority and publish before rejecting https://github.com/codeigniter4/queue/pull/107/files#top
Show all changes 3 commits https://github.com/codeigniter4/queue/pull/107/files
5521de9 fix: keep RabbitMQ delays per priority and publish before rejecting gr8man Nov 10, 2026 https://github.com/codeigniter4/queue/pull/107/commits/5521de9bf50e7753c0210899fbc93fbe4d0a0686
0059d76 test: add unit tests for RabbitMQ priority-based delay queue naming a… gr8man Nov 10, 2026 https://github.com/codeigniter4/queue/pull/107/commits/0059d76ba2b51d77bb14c70f93f2e090a4f7b677
ddf8ef7 fix: ensure exchange declared and bind once in delayed publish gr8man Nov 10, 2026 https://github.com/codeigniter4/queue/pull/107/commits/ddf8ef7a013efff03345ba4eda9e121ce580573c
Clear filters https://github.com/codeigniter4/queue/pull/107/files
Please reload this pagehttps://github.com/codeigniter4/queue/pull/107/files
Please reload this pagehttps://github.com/codeigniter4/queue/pull/107/files
RabbitMQHandler.php https://github.com/codeigniter4/queue/pull/107/files#diff-b393c48bbeb5f800ee4ef158cbd56f43541a284e91356540a8a38827288cfb9b
RabbitMQHandlerUnitTest.php https://github.com/codeigniter4/queue/pull/107/files#diff-20f975c53f62b48027f76f7c38c587149496527c22cb3590d1fc2ebbb1d35226
src/Handlers/RabbitMQHandler.phphttps://github.com/codeigniter4/queue/pull/107/files#diff-b393c48bbeb5f800ee4ef158cbd56f43541a284e91356540a8a38827288cfb9b
View file https://github.com/codeigniter4/queue/blob/ddf8ef7a013efff03345ba4eda9e121ce580573c/src/Handlers/RabbitMQHandler.php
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/codeigniter4/queue/pull/107/{{ revealButtonHref }}
https://github.com/codeigniter4/queue/pull/107/files#diff-b393c48bbeb5f800ee4ef158cbd56f43541a284e91356540a8a38827288cfb9b
https://github.com/codeigniter4/queue/pull/107/files#diff-b393c48bbeb5f800ee4ef158cbd56f43541a284e91356540a8a38827288cfb9b
https://github.com/codeigniter4/queue/pull/107/files#diff-b393c48bbeb5f800ee4ef158cbd56f43541a284e91356540a8a38827288cfb9b
https://github.com/codeigniter4/queue/pull/107/files#diff-b393c48bbeb5f800ee4ef158cbd56f43541a284e91356540a8a38827288cfb9b
https://github.com/codeigniter4/queue/pull/107/files#diff-b393c48bbeb5f800ee4ef158cbd56f43541a284e91356540a8a38827288cfb9b
https://github.com/codeigniter4/queue/pull/107/files#diff-b393c48bbeb5f800ee4ef158cbd56f43541a284e91356540a8a38827288cfb9b
https://github.com/codeigniter4/queue/pull/107/files#diff-b393c48bbeb5f800ee4ef158cbd56f43541a284e91356540a8a38827288cfb9b
https://github.com/codeigniter4/queue/pull/107/files#diff-b393c48bbeb5f800ee4ef158cbd56f43541a284e91356540a8a38827288cfb9b
https://github.com/codeigniter4/queue/pull/107/files#diff-b393c48bbeb5f800ee4ef158cbd56f43541a284e91356540a8a38827288cfb9b
https://github.com/codeigniter4/queue/pull/107/files#diff-b393c48bbeb5f800ee4ef158cbd56f43541a284e91356540a8a38827288cfb9b
https://github.com/codeigniter4/queue/pull/107/files#diff-b393c48bbeb5f800ee4ef158cbd56f43541a284e91356540a8a38827288cfb9b
https://github.com/codeigniter4/queue/pull/107/files#diff-b393c48bbeb5f800ee4ef158cbd56f43541a284e91356540a8a38827288cfb9b
https://github.com/codeigniter4/queue/pull/107/files#diff-b393c48bbeb5f800ee4ef158cbd56f43541a284e91356540a8a38827288cfb9b
https://github.com/codeigniter4/queue/pull/107/files#diff-b393c48bbeb5f800ee4ef158cbd56f43541a284e91356540a8a38827288cfb9b
Please reload this pagehttps://github.com/codeigniter4/queue/pull/107/files
Please reload this pagehttps://github.com/codeigniter4/queue/pull/107/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.