Skip to content

Align AMQP adapter with current queue core#127

Merged
samdark merged 10 commits into
masterfrom
current-core-compat
Jun 4, 2026
Merged

Align AMQP adapter with current queue core#127
samdark merged 10 commits into
masterfrom
current-core-compat

Conversation

@samdark

@samdark samdark commented Jun 4, 2026

Copy link
Copy Markdown
Member
  • align status types, queue defaults, message/test helpers, and middleware factory names with the current yiisoft/queue core
  • adapt AMQP delay middleware to the current push middleware pipeline by using DelayEnvelope metadata
  • translate delay metadata in the AMQP adapter when publishing delayed messages
  • normalize AMQP delayed-message TTL and expiration values to integer milliseconds
  • use string AMQP expiration values for delayed messages
  • skip delay envelope wrapping for non-positive middleware delays
  • rename the internal queue provider API from channel naming to queue naming
  • update queue CLI test helpers to use the current positional queue-name argument
  • add cleanup for queue settings tests to avoid leftover AMQP queues/exchanges between runs
  • add optional AMQP QoS settings and apply basic_qos before consuming messages
  • simplify queue provider channel-id handling and remove redundant settings-test adapter setup
  • keep benchmark runs on the PR head and skip baseline comparison when the base branch baseline cannot be created

Copilot AI review requested due to automatic review settings June 4, 2026 12:31

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 DelayEnvelope metadata; AMQP adapter translates it when publishing.
  • Update unit/integration tests, benchmarks, and the tests/yii console 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.

Comment thread src/Adapter.php
Comment thread src/Adapter.php Outdated
Comment thread src/Middleware/DelayMiddleware.php
Co-authored-by: viktorprogger <viktorprogger@gmail.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 17 out of 17 changed files in this pull request and generated no new comments.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 23 out of 23 changed files in this pull request and generated 2 comments.

Comment thread tests/Unit/QueueTest.php Outdated
Comment thread .github/workflows/bechmark.yml
@samdark samdark merged commit a02e3e4 into master Jun 4, 2026
22 checks passed
@samdark samdark deleted the current-core-compat branch June 4, 2026 21:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants