title: Amazon SQS Java SDK - cannot receive message attributes
body: <p>After posting a message with an attribute to SQS with the following code before sending it (and checking in SQS console to see if everything is posted correctly)...</p>
  
  <pre><code>messageRequest.addMessageAttributesEntry(
          "attributeTest", 
          new MessageAttributeValue()
              .withDataType("String")
              .withStringValue("attributeTest 123"));
  </code></pre>
  
  <p>I cannot retrieve any of the message attributes in the message. All I see, as a result, is "0 attributes.". Reinspecting the message in Amazon SQS console, the message - and the attribute - are still there.</p>
  
  <pre><code>// Message was previously checked in SQS console and contains 
  // an attribute named "attributeTest"
  
  AmazonSQS sqs = ...
  List&lt;Message&gt; messages = sqs.receiveMessage(receiveMessageRequest).getMessages();
  for (Message : messages) 
  {
      Map&lt;String, MessageAttributeValue&gt; attributes = message.getMessageAttributes();
      System.out.println("" + attributes.size() + " attributes.");
  }
  </code></pre>
  
  <p>I am using Amazon SQS SDK v1.8 in Java 1.7 with Play Framework 2.2.3. At first I thought it could be the SQS version but tried upgrading to 1.8.7 with no avail.</p>
  
  <p>The official documentation found <a href="http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/SQSMessageAttributes.html" rel="noreferrer">here</a> does not provide any sourcecode to read the attributes at all. Nor github searches, stack overflow. I've been trying for a few hours without any success.</p>
  
  <p>Thanks for any help!</p>