Align AMQP adapter with current queue core#127
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the AMQP adapter package to match the current yiisoft/queue core API: renaming middleware factories/config types, aligning default queue identifiers and message/status types, and reworking delayed-message handling to use DelayEnvelope metadata (with the adapter translating that metadata into AMQP TTL/DLX publishing).
Changes:
- Align queue core types and factories (status type, queue defaults, middleware factory/config names, helper message type).
- Rework delay support: delay middleware now adds
DelayEnvelopemetadata; AMQP adapter translates it when publishing. - Update unit/integration tests, benchmarks, and the
tests/yiiconsole script to the new queue core APIs.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/yii | Updates CLI example wiring to new middleware factories/config and queue provider defaults. |
| tests/Unit/UnitTestCase.php | Adjusts test harness to new Queue/Worker construction and push middleware config usage. |
| tests/Unit/QueueTest.php | Aligns tests with new exception/message classes and adapter injection pattern. |
| tests/Unit/QueueSettingsTest.php | Updates message helper type and adapter wiring for queue settings tests. |
| tests/Unit/QueueProviderTest.php | Updates message helper type and queue creation with adapter. |
| tests/Support/FakeAdapter.php | Updates adapter status return type to MessageStatus. |
| tests/Integration/DelayMiddlewareTest.php | Updates delay flow test to middleware-config style and new failure expectations. |
| tests/Integration/ConsumeExistingMessagesTest.php | Updates message helper type import. |
| tests/Benchmark/QueuePushBench.php | Updates message helper type import. |
| tests/Benchmark/QueueConsumeBench.php | Updates message helper type import. |
| src/Settings/Queue.php | Aligns default queue name constant with QueueProviderInterface::DEFAULT_QUEUE. |
| src/Middleware/DelayMiddleware.php | Replaces AMQP-specific delay middleware with a DelayEnvelope-based push middleware. |
| src/Adapter.php | Adds delayed-publish translation based on DelayEnvelope metadata and updates status type. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: viktorprogger <viktorprogger@gmail.com>
Co-authored-by: viktorprogger <viktorprogger@gmail.com>
This was referenced Jun 4, 2026
Closed
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.
yiisoft/queuecoreDelayEnvelopemetadatabasic_qosbefore consuming messages