Resources



Sample Code and Libraries

C# Library for Amazon SQS

Click for a printer friendly version of this document Printer Friendly Save to del.icio.us
 

C# Library for Amazon SQS

Submitted By: Elena@AWS  
AWS Products Used: Amazon SQS
Language(s): C#
License: Apache License 2.0

IMPORTANT: This library has been deprecated and will no longer be updated. We recommend developers switch to the new AWS SDK for .NET, which is almost identical to this library, where you’ll continue to get new feature updates and bug fixes. To learn more about the AWS SDK for .NET, and for support with migration, see http://aws.amazon.com/sdkfornet.

About this Library

  • Based on the 2009-02-01 API version.

What's New?

  • 2009-04-08: Support for access control API
  • 2008-12-26: Support empty parameter values
  • 2008-12-23: Fix for UTF8 url encoding for signature version 2
  • 2008-12-17: Support for signature version 2, https endpoint
  • 2008-02-29: Initial Release

Prerequisites

Package Content

Directory Overview
src Source distribution of the library. All sources including code samples that demonstrate the use of the library located under this directory.

Quick Start

Library comes with C# solution and two pre-configured C# projects.
  • Amazon.SQS.csproj - main library project
  • Amazon.SQS.Samples.csproj - library samples project
To get started with the library, follow these steps:
  1. Extract the amazon-queue-2009-02-01-cs-library.zip file into a working directory.
  2. Open Amazon.SQS.sln solution file in Visual Studio 2005
  3. Hit F5 key and follow on screen instruction

Running Samples

Steps to run particular sample
  • Open AmazonSQSSamples.cs file under Amazon.SQS.Samples project
  • Set AWS Access Key ID and AWS Secret Access Key
  • String accessKeyId = "<Your Access Key ID>";
    String secretAccessKey = "<Your Secret Access Key>";
        


  • Set request parameters. For example, find following pre-generated snippet:
  • // CreateQueueRequest request = new CreateQueueRequest ();
    // @TODO: set request parameters here
    // CreateQueueSample.InvokeCreateQueue(service, request);
        


  • Uncomment first and third line and set QueueName
  • CreateQueueRequest request = new CreateQueueRequest ();
    request.QueueName = "MyQueue";
    CreateQueueSample.InvokeCreateQueue(service, request);
    
        

  • Hit F5 to run sample. You should see the output similar to the following:


  •     CreateQueueResponse
            CreateQueueResult
                QueueUrl
                    http://queue.amazonaws.com/MyQueue
            ResponseMetadata
                RequestId
                    95cdcb68-f46c-400b-8265-8c2de2a5c475
        


  • Experiment with other samples, examine samples sources. When ready, add library project to your solution, and use it.

Happy coding!

Comments, Questions or Feedback

If you have any comments, questions or feedback on the library, please visit the Amazon SQS discussion forums.

Discussion

The 5 most recent discussion messages. View full discussion.

Gabriel
Posts: 4
Registered: 3/22/06
C# Library for Amazon SQS
Posted: Sep 17, 2008 8:38 AM PDT
 
  Click to reply to this thread Reply

I just started using this library and am generally pleased so far.  I've noticed one minor issue: The AmazonSQSClient object operates on short queue names, rather than full URLs.  This appears to be violating the API:
In your system, always store the entire queue URL as SQS returned it to you when you created the queue (for example, http://queue.amazonaws.com/queue2). Don't build the queue URL from its separate components each time you need to specify the queue URL in a request because SQS could change the components that make up the queue URL.
http://docs.amazonwebservices.com/AWSSimpleQueueService/2008-01-01/SQSDeveloperGuide/ImportantIdentifiers.html

Edit: Referring to
http://developer.amazonwebservices.com/connect/entry.jspa?externalID=1284



Reviews
Create Review Write a Review
Be the first to review this.
Welcome, Guest Help
Login Login