Understand the AWS Messaging application - AWS SDK for JavaScript

Help us improve the AWS SDK for JavaScript version 3 (V3) documentation by providing feedback using the Feedback link, or create an issue or pull request on GitHub.

The AWS SDK for JavaScript V3 API Reference Guide describes in detail all the API operations for the AWS SDK for JavaScript version 3 (V3).

Understand the AWS Messaging application

This topic is part of a tutorial that create an AWS application that sends and retrieves messages by using the AWS SDK for JavaScript and Amazon Simple Queue Service (Amazon SQS). To start at the beginning of the tutorial, see Creating an example messaging application.

To send a message to a SQS queue, enter the message into the application and choose Send.

After the message is sent, the application displays the message, as shown in this figure.

You can choose Purge to purge the messages from the Amazon SQS queue. This results in an empty queue, and no messages are displayed in the application.

The following describes how the application handles a message:

  • The user selects their name and enters their message, and submits the message, which initiates the pushMessage function.

  • pushMessage retrieves the Amazon SQS Queue Url, and then sends a message with a unique message ID value (a GUID)the message text, and the user to the Amazon SQS Queue.

  • pushMessage retrieves the messages from the Amazon SQS Queue, extracts the user and message for each message, and displays the messages.

  • The user can purge the messages, which delete the messages from the Amazon SQS Queue and from the user interface.