-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Messenger] fixed RabbitMQ arguments not passed as integer values #29532
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Messenger] fixed RabbitMQ arguments not passed as integer values #29532
Conversation
src/Symfony/Component/Messenger/Transport/AmqpExt/Connection.php
Outdated
Show resolved
Hide resolved
return $queueOptions; | ||
} | ||
|
||
foreach ($queueOptions['arguments'] as $key => $value) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you could do
foreach (array('x-max-..', ...) as $key) {
if (isset($queueOptions['arguments'][$key]) { ... }
}
and save a few lines. Also im wondering if it's better to add private function getArguments()
and normalize when needed (i.e. setArguments(getArguments())
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I refactored that part. I added a constant keeping all the arguments that should be an integer, and later iterating over that. wdyt?
src/Symfony/Component/Messenger/Transport/AmqpExt/Connection.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Messenger/Transport/AmqpExt/Connection.php
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This patch is a good entry point to find solution of the bug.
But it left to provide a scale-able solution for arguments schema.
Status: Needs Work
src/Symfony/Component/Messenger/Transport/AmqpExt/Connection.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Messenger/Transport/AmqpExt/Connection.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Messenger/Transport/AmqpExt/Connection.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Messenger/Transport/AmqpExt/Connection.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Messenger/Transport/AmqpExt/Connection.php
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alquerci added handling of null and not-integer values, maybe some more tests should be added? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
src/Symfony/Component/Messenger/Transport/AmqpExt/Connection.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Messenger/Tests/Transport/AmqpExt/ConnectionTest.php
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
src/Symfony/Component/Messenger/Tests/Transport/AmqpExt/ConnectionTest.php
Outdated
Show resolved
Hide resolved
@alquerci is there any other change to be done? :) |
It was triggered by my last review pass #29532 (review) Now the patch looks good except for the doubt I have:
|
Looks good to me. |
👌 |
Thank you @thePanz. |
… values (thePanz) This PR was submitted for the 4.1 branch but it was merged into the 4.2 branch instead (closes #29532). Discussion ---------- [Messenger] fixed RabbitMQ arguments not passed as integer values | Q | A | ------------- | --- | Branch? | 4.2 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #29044 | License | MIT RabbitMQ expects some arguments to be passed as integer values. Make sure to cast those after parsing the DSN \cc @thomaskonrad Commits ------- f19c035 [Messenger] fixed RabbitMQ arguments not passed as integer values
RabbitMQ expects some arguments to be passed as integer values.
Make sure to cast those after parsing the DSN
\cc @thomaskonrad