Skip to content

The behavior on sending message-attributes with empty value is different from that of SQS #373

@ara-ta3

Description

@ara-ta3

When I send a message to sqs with empty value, sqs returns error (InvalidParameterValue).

cat attributes.json
{
  "piyo": {
    "DataType": "String",
    "StringValue": ""
  }
}
aws sqs send-message \
    --queue-url https://sqs.ap-northeast-1.amazonaws.com/XXXXXXXXXX/elastic-mq-debug \
    --message-body bar \
    --message-attributes file://attributes.json
An error occurred (InvalidParameterValue) when calling the SendMessage operation: Message (user) attribute 'piyo' must contain a non-empty value of type 'String'.

But elastmq does not return error.

 java -jar elasticmq-server-0.15.7.jar
...

aws --endpoint-url http://localhost:9324 sqs create-queue --queue-name foo
{
    "QueueUrl": "http://localhost:9324/queue/foo"
}
cat attributes.json
{
  "piyo": {
    "DataType": "String",
    "StringValue": ""
  }
}
aws --endpoint-url http://localhost:9324 \
    sqs send-message \
    --queue-url http://localhost:9324/queue/foo \
    --message-body bar \
    --message-attributes file://attributes.json
{
    "MD5OfMessageBody": "37b51d194a7513e45b56f6524f2d51f2",
    "MD5OfMessageAttributes": "4166cc16b73099be3abe8e2b0f544c99",
    "MessageId": "62aa4db3-9666-4421-a1d8-b988f76b7ae1"
}
echo $?
0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions