Skip to content
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

problem with TTR parameter and AWS SQS queue #511

Open
mfrattola opened this issue Apr 19, 2024 · 2 comments
Open

problem with TTR parameter and AWS SQS queue #511

mfrattola opened this issue Apr 19, 2024 · 2 comments

Comments

@mfrattola
Copy link

What steps will reproduce the problem?

I have a fifo queue on AWS SQS service.

When I try to queue an element to the queue, I receive this error from the AWS SDK

yii\base\ErrorException: The provided type for MessageAttributes -> TTR -> StringValue value was integer. The modeled type is string. in /var/www/html/pmstore/vendor/aws/aws-sdk-php/src/QueryCompatibleInputMiddleware.php:165

What's expected?

that the element would be queued

What do you get instead?

the error listed above

I notice that at line 200 of \vendor\yiisoft\yii2-queue\src\drivers\sqs\Queue.php

'MessageAttributes' => [
'TTR' => [
'DataType' => 'Number',
'StringValue' => $ttr,
],
],

If I cast $ttr to string, it works as expected

Additional info

Q A
Yii version 2.0.49.3
PHP version 7.4
Operating system Debian 11
AWS SDK 3.304.4
@mfrattola
Copy link
Author

Honestrly I don't understand. The fix seems to have been already applied, but the file I downloaded with composer don't have the fix.

from the composer.lock file

"name": "yiisoft/yii2-queue",
"version": "2.3.6",
"source": {
"type": "git",
"url": "https://github.com/yiisoft/yii2-queue.git",
"reference": "5c14c3f6e83b2e2d150a969dc6eda4e083b73956"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/yiisoft/yii2-queue/zipball/5c14c3f6e83b2e2d150a969dc6eda4e083b73956",
"reference": "5c14c3f6e83b2e2d150a969dc6eda4e083b73956",
"shasum": ""
},

and the code in question is

'MessageAttributes' => [
'TTR' => [
'DataType' => 'Number',
'StringValue' => $ttr,
],
],

@rob006
Copy link

rob006 commented Apr 24, 2024

Try dev-master - this fix has not been released yet.

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

No branches or pull requests

2 participants