title: Wrong SQS AWS message when I'm subscribed from a SNS Topic
body: <p>I'm having problems with the next design: </p>
  
  <p><a href="https://i.stack.imgur.com/2awMJ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2awMJ.png" alt="enter image description here"></a></p>
  
  <p>When I'm receiving the message in my SQS Subscriber, the model of message it's wrong, example:</p>
  
  <pre><code>{
    "Type" : "Notification",
    "MessageId" : "7a6789f0-02f0-5ed3-8a11-deebcd08f145",
    "TopicArn" : "arn:aws:sns:us-east-2:167186109795:name_sns_topic",
    "Message" : "My JSON message",
    "Timestamp" : "1987-04-23T17:17:44.897Z",
    "SignatureVersion" : "1",
    "Signature" : "string",
    "SigningCertURL" : "url",
    "UnsubscribeURL" : "url",
    "MessageAttributes" : {
      "X-Header1" : {"Type":"String","Value":"value1"},
      "X-Header2" : {"Type":"String","Value":"value2"},
      "X-Header3" : {"Type":"String","Value":"value3"},
      "X-HeaderN" : {"Type":"String","Value":"value4"}
    }
  }
  </code></pre>
  
  <p>The common model when recieve message from SQS should be: </p>
  
  <pre><code>{
    "Records": [
      {
        "messageId": "19dd0b57-b21e-4ac1-bd88-01bbb068cb78",
        "receiptHandle": "MessageReceiptHandle",
        "body": "Hello from SQS!",
        "attributes": {
          "ApproximateReceiveCount": "1",
          "SentTimestamp": "1523232000000",
          "SenderId": "123456789012",
          "ApproximateFirstReceiveTimestamp": "1523232000001"
        },
        "messageAttributes": {},
        "md5OfBody": "7b270e59b47ff90a553787216d55d91d",
        "eventSource": "aws:sqs",
        "eventSourceARN": "arn:{partition}:sqs:{region}:123456789012:MyQueue",
        "awsRegion": "{region}"
      }
    ]
  }
  </code></pre>
  
  <p>In my handler Java Lambda (example code) is throwing an exception because the estructure of de message received is not SQS Event: </p>
  
  <pre><code>public class MyHandler implements RequestHandler&lt;SQSEvent, String&gt; {
  
    @Override
    public String handleRequest(SQSEvent event, Context context) {
      LambdaLogger logger = context.getLogger();
  
      for (SQSEvent.SQSMessage msg : event.getRecords()) {
        logger.log("SQS message body: " + msg.getBody());
        logger.log("Get attributes: " + msg.getMessageAttributes().toString());
  
        msg.getMessageAttributes()
                .forEach(
                        (k, v) -&gt; {
                          logger.log("key: " + k + "value: " + v.getStringValue());
                        });
      }
      return "Successful";
    }
  }
  
  How can I do for handle the message thats its receiving ?
  
  </code></pre>