{"action":"created","issue":{"url":"https://api.github.com/repos/awslabs/aws-sdk-cpp/issues/39","repository_url":"https://api.github.com/repos/awslabs/aws-sdk-cpp","labels_url":"https://api.github.com/repos/awslabs/aws-sdk-cpp/issues/39/labels{/name}","comments_url":"https://api.github.com/repos/awslabs/aws-sdk-cpp/issues/39/comments","events_url":"https://api.github.com/repos/awslabs/aws-sdk-cpp/issues/39/events","html_url":"https://github.com/awslabs/aws-sdk-cpp/issues/39","id":115740862,"number":39,"title":"Issues setting message attributes on SQS batch send message requests","user":{"login":"asylvest","id":11707082,"avatar_url":"https://avatars.githubusercontent.com/u/11707082?v=3","gravatar_id":"","url":"https://api.github.com/users/asylvest","html_url":"https://github.com/asylvest","followers_url":"https://api.github.com/users/asylvest/followers","following_url":"https://api.github.com/users/asylvest/following{/other_user}","gists_url":"https://api.github.com/users/asylvest/gists{/gist_id}","starred_url":"https://api.github.com/users/asylvest/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asylvest/subscriptions","organizations_url":"https://api.github.com/users/asylvest/orgs","repos_url":"https://api.github.com/users/asylvest/repos","events_url":"https://api.github.com/users/asylvest/events{/privacy}","received_events_url":"https://api.github.com/users/asylvest/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-11-08T16:00:20Z","updated_at":"2016-02-27T13:30:50Z","closed_at":"2016-02-24T01:15:01Z","body":"Setting the message body and attributes on a `SendMessageRequest` works as expected for me.  When I try to send a `SendMessageBatchRequest`, setting the message body and string attributes on each message, the message body makes it through as expected but no attributes do.  I've tried doing this two different ways (there are a few lines of code specific to my repo mixed in here but I think this should be pretty legible... if you can't recreate this and want a self-contained application, I can put one together):\r\n\r\n```\r\nvoid SQSClient::sendMessageBatch(\r\n        const std::vector<std::string>& messageBody,\r\n        const std::vector<std::map<std::string, std::string>>& attributes)\r\n{\r\n    if (messageBody.size() != attributes.size())\r\n    {\r\n        throw except::Exception(Ctxt(\"Sizes don't match\"));\r\n    }\r\n\r\n    SendMessageBatchRequest request;\r\n\r\n    std::vector<SendMessageBatchRequestEntry> entries(messageBody.size());\r\n    for (size_t ii = 0; ii < messageBody.size(); ++ii)\r\n    {\r\n        SendMessageBatchRequestEntry entry;\r\n        entry.SetMessageBody(messageBody[ii].c_str());\r\n\r\n        const std::string id(\"some-batch-id-\" + str::toString(ii));\r\n\r\n        entry.SetId(id.c_str());\r\n\r\n        // Try #1\r\n        Aws::Map<Aws::String, MessageAttributeValue> attMap;\r\n        for (auto iter : attributes[ii])\r\n        {\r\n            MessageAttributeValue stringAttributeValue;\r\n            stringAttributeValue.SetStringValue(iter.second.c_str());\r\n            stringAttributeValue.SetDataType(\"String\");\r\n\r\n            attMap[iter.first.c_str()] = stringAttributeValue;\r\n        }\r\n        entry.SetMessageAttributes(attMap);\r\n\r\n        // Try #2\r\n        for (auto iter : attributes[ii])\r\n        {\r\n            MessageAttributeValue stringAttributeValue;\r\n            stringAttributeValue.SetStringValue(iter.second.c_str());\r\n            stringAttributeValue.SetDataType(\"String\");\r\n            entry.AddMessageAttributes(iter.first.c_str(), stringAttributeValue);\r\n        }\r\n\r\n        request.AddEntries(entry);\r\n    }\r\n\r\n    request.SetQueueUrl(mQueueUrl);\r\n\r\n    // This succeeds, and the message bodies make it through, but no attributes do\r\n    SendMessageBatchOutcome outcome = mSqsClient->SendMessageBatch(request);\r\n}\r\n```\r\n\r\nIf I'm just doing something dumb, please let me know. :o)"},"comment":{"url":"https://api.github.com/repos/awslabs/aws-sdk-cpp/issues/comments/189639092","html_url":"https://github.com/awslabs/aws-sdk-cpp/issues/39#issuecomment-189639092","issue_url":"https://api.github.com/repos/awslabs/aws-sdk-cpp/issues/39","id":189639092,"user":{"login":"asylvest","id":11707082,"avatar_url":"https://avatars.githubusercontent.com/u/11707082?v=3","gravatar_id":"","url":"https://api.github.com/users/asylvest","html_url":"https://github.com/asylvest","followers_url":"https://api.github.com/users/asylvest/followers","following_url":"https://api.github.com/users/asylvest/following{/other_user}","gists_url":"https://api.github.com/users/asylvest/gists{/gist_id}","starred_url":"https://api.github.com/users/asylvest/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asylvest/subscriptions","organizations_url":"https://api.github.com/users/asylvest/orgs","repos_url":"https://api.github.com/users/asylvest/repos","events_url":"https://api.github.com/users/asylvest/events{/privacy}","received_events_url":"https://api.github.com/users/asylvest/received_events","type":"User","site_admin":false},"created_at":"2016-02-27T13:30:50Z","updated_at":"2016-02-27T13:30:50Z","body":"I just tried this from a fresh clone and build of the SDK.  Unfortunately, I still get the same behavior as before with either of the two approaches above."}}