Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Messenger] Adding final routing key to delay queue name#31355

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

@weaverryan
Copy link
Member

QA
Branch?master
Bug fix?yes
New feature?no
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets#31241
LicenseMIT
Doc PRn/a

Fixes#31241.

When we delay, we create a queue whosex-message-ttl matches the delay length andx-dead-letter-routing-key matches the original routing key used for the message. However, before this PR, the original routing key was not part of that queue's name. The result is that if two messages were delayed by the same length, but with different routing keys, the second would try to "redeclare" the existing delay queue with a newx-dead-letter-routing-key, resulting in an error similar to:

Server channel error: 406, message: PRECONDITION_FAILED - inequivalent arg 'x-dead-letter-routing-key' for queue 'delay_queue_1000'

Integration test was improved to catch this.

Cheers!

@weaverryanweaverryanforce-pushed thefix-delay-queue-routing-key branch fromcb757e2 to9940e71CompareMay 7, 2019 01:02
@fabpot
Copy link
Member

Thank you@weaverryan.

@fabpotfabpot merged commit9940e71 intosymfony:masterMay 7, 2019
fabpot added a commit that referenced this pull requestMay 7, 2019
…weaverryan)This PR was merged into the 4.3-dev branch.Discussion----------[Messenger] Adding final routing key to delay queue name| Q             | A| ------------- | ---| Branch?       | master| Bug fix?      | yes| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets |#31241| License       | MIT| Doc PR        | n/aFixes#31241.When we delay, we create a queue whose `x-message-ttl` matches the delay length and `x-dead-letter-routing-key` matches the original routing key used for the message. However, before this PR, the original routing key was not part of that queue's name. The result is that if two messages were delayed by the same length, but with different routing keys, the second would try to "redeclare" the existing delay queue with a new `x-dead-letter-routing-key`, resulting in an error similar to:> Server channel error: 406, message: PRECONDITION_FAILED - inequivalent arg 'x-dead-letter-routing-key' for queue 'delay_queue_1000'Integration test was improved to catch this.Cheers!Commits-------9940e71 fixing a bug where the delay queue name did not contain the final routing key
$actualDuration =microtime(true) -$startTime;

if (\method_exists([$this,'assertEqualsWithDelta'])) {
$this->assertEqualsWithDelta($expectedDuration,$actualDuration,'Duration was not within expected range',.5);
Copy link
Contributor

Choose a reason for hiding this comment

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

the order of arguments is wrong.assertEqualsWithDelta($expected, $actual, float $delta, string $message = '')

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

I'm on it

@weaverryanweaverryan deleted the fix-delay-queue-routing-key branchMay 7, 2019 14:19
weaverryan added a commit to weaverryan/symfony that referenced this pull requestMay 7, 2019
fabpot added a commit that referenced this pull requestMay 8, 2019
This PR was merged into the 4.3-dev branch.Discussion----------[Messenger] Fixing missed tests from#31355| Q             | A| ------------- | ---| Branch?       | master| Bug fix?      | yes| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets | none| License       | MIT| Doc PR        | not neededTests I missed from#31355 - sorry about that!Commits-------ab37449 Fixing missed tests from#31355
Tobion added a commit that referenced this pull requestJun 14, 2019
…obion)This PR was merged into the 4.3 branch.Discussion----------[Messenger] fix delay delivery for non-fanout exchanges| Q             | A| ------------- | ---| Branch?       | 4.3| Bug fix?      | yes| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->| BC breaks?    | no     <!-- seehttps://symfony.com/bc -->| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->| Fixed tickets || License       | MIT| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->Fixes two bugs and outdated phpdoc:1. When your exchange is not of type fanout, but direct for example, then delivery of delayed (retrying) messages does not work. This is because the delay logics adds a routing key to message. It was fixed if you have a custom routing key in#31355. But if you have no routing key, it still changed the routing key which means the message will not be delivery from your direct exchange to your queue anymore after being in the delay exchange. For fanout, which is the default, it does not matter because the routing key is ignored.2. also fix dsn parsing of plain `amqp://` which is a valid URI that parse_url cannot handle when you want to pass all parameters as optionsCommits-------0f15306 [Messenger] fix delay delivery for non-fanout exchanges
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

1 more reviewer

@TobionTobionTobion left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

4.3

Development

Successfully merging this pull request may close these issues.

[Messenger] SF 4.3 AMQP publish with delay invalid x-dead-letter-routing-key

4 participants

@weaverryan@fabpot@Tobion@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp