Skip to content

Latest commit

 

History

History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Amazon Simple Queue Service (Amazon SQS) Code Examples in C#

Purpose

This folder contains examples that show how to use the AWS SDK for .NET 3.x to get started using queue and message operations in Amazon Simple Queue Service (Amazon SQS). The examples will show you how to create a queue and send, receive, and delete messages from it.

Prerequisites

Cautions

  • As an AWS best practice, grant this code least privilege, or only the permissions required to perform a task. For more information, see Grant Least Privilege in the AWS Identity and Access Management User Guide.
  • This code has not been tested in all AWS Regions. Some AWS services are available only in specific Regions. For more information, see the AWS Region Table on the AWS website.
  • Running this code might result in charges to your AWS account.

Running the tests

Navigate to the folder that contains the test application, CreateSendExample for instance, and run:

dotnet test

If you want more information, run:

dotnet test -l "console;verbosity=detailed"

Running the examples

The examples in this folder use the default user account. The call to initialize the Amazon SQS client supplies the region. Change the region to match your own before running the example.

Once the example has been compiled, you can run it from the commandline by first navigating to the folder that contains the .csproj file, and then issuing the following command:

dotnet run

Or you can execute the example from within your IDE.

Example Description
CreateSendExample Create an SQS queue and sends a sample message.
ReceiveDelete Receives a single message from the queue and then deletes it from the queue.

Additional information


Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. SPDX-License-Identifier: Apache-2.0