yiisoft / yiisoft/yii2-queue

problem with TTR parameter and AWS SQS queue

Open
#511 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
1.1k
Forks
285
Avg merge
5d 3h
Merged PRs (30d)
2

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in src/drivers/sqs/Queue.php around line 200 and reproduce the FIFO queue case with the listed Yii, PHP, Debian, and AWS SDK versions. Inspect how TTR is passed in MessageAttributes and verify the expected result by queuing an element without the AWS SDK type error.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, php
Domain
backend, cloud
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.