aws / aws-sdk-php-symfony

Apache License 2.0
350 stars 89 forks source link

SQS Bulks issue #100

Closed ibrahimMH13 closed 11 months ago

ibrahimMH13 commented 11 months ago

Describe the bug

I've tried pushing bulk payloads using sendMessageBatch and it pushed after that throws an exception

InvalidArgumentException {#17
  #message: """
    Found 1 error while validating the input provided for the SendMessageBatch operation:
    [Entries][0] must be an associative array. Found array(6)
    """
  #code: 0
  #file: "[/var/www/html/vendor/aws/aws-sdk-php/src/Api/Validator.php](https://my-dev-local.insead.edu/_profiler/open?file=vendor/aws/aws-sdk-php/src/Api/Validator.php&line=65#line65)"
  #line: 65 

I've seen my message into the queue via my console web so I don't know why its throw this exception and its works fine with same payload when I've used sendMessage

its strange behavior of it

Expected Behavior

pushing without expcetions

Current Behavior

sendMessageBatch throws an exception after push messages

Reproduction Steps

public function sendMessages(array $payload)
{
    $result = $this->client->sendMessageBatch($payload);
    $failed = $result->get('Failed');
    if (!empty($failed)) {
        foreach ($failed as $failure) {
            echo "Failed sending message: {$failure['Id']}, Code: {$failure['Code']}, Message: {$failure['Message']}\n";
        }
    }
    if (!empty($result->get('Successful'))) {
        foreach ($result->get('Successful') as $value) {
            echo "Successful sending message: {$value['Id']}\n<br/>";
        }
    }
}

Possible Solution

No response

Additional Information/Context

No response

SDK version used

2.6.1

Environment details (OS name and version, etc.)

ubuntu 20

github-actions[bot] commented 11 months ago

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.