Search code examples
amazon-snsaws-java-sdk

How many records does SNSEvent Object's getRecords() return?


How many records will be returned and how does it actually work?

public String handleRequest(SNSEvent snsEvent, Context context) {
        List<SNSRecord> records = snsEvent.getRecords();
        System.out.println("Size "+ records.size());
        return "success";
} 


Solution

  • Read the docs:

    Q: Will a notification contain more than one message?

    No, all notification messages will contain a single published message.