Skip to content
This repository was archived by the owner on Mar 8, 2023. It is now read-only.

geekleio/amazon-sqs

Repository files navigation

WBPA.Amazon.SimpleQueueService

WBPA.Amazon.SimpleQueueService

The WBPA.Amazon assembly provides extensions and generic classes to help ease the usage towards AWS and is the core member of a range of wrappers tailored to the AWSSDK.

Useful links for this project:

Installation

From the Package Manager: Install-Package WBPA.Amazon.SimpleQueueService -Version 1.0.0.2270.

SendMessage Example

using (var manager = new StandardMessageQueueManager(Endpoint, new BasicAWSCredentials(AccessKey, SecretKey)))
{
    var response = await manager.SendAsync("Message!").ConfigureAwait(false);
    // do something with the response
}

SendBatchMessage Example

using (var manager = new StandardMessageQueueManager(Endpoint, new BasicAWSCredentials(AccessKey, SecretKey)))
{
    var response = await manager.SendBatchAsync(EnumerableUtility.RangeOf(10, i => "Message {0}!".FormatWith(i))).ConfigureAwait(false);
    // do something with the response
}

SendManyBatchMessage Example

using (var manager = new StandardMessageQueueManager(Endpoint, new BasicAWSCredentials(AccessKey, SecretKey)))
{
    var responses = await manager.SendManyBatchAsync(EnumerableUtility.RangeOf(200, i => "Message {0}!".FormatWith(i))).ConfigureAwait(false);
    foreach (var response in responses)
    {
        // do something with the response
    }
}

ReceiveMessage Example

using (var manager = new StandardMessageQueueManager(Endpoint, new BasicAWSCredentials(AccessKey, SecretKey)))
{
    var response = await manager.ReceiveAsync(options =>
    {
        options.AttributeNames.GetAll();
    }).ConfigureAwait(false);
    // do something with the response
}

ReceiveManyMessage Example

using (var manager = new StandardMessageQueueManager(Endpoint, new BasicAWSCredentials(AccessKey, SecretKey)))
{
    var responses = await manager.ReceiveManyAsync(200, options =>
    {
        options.MaxNumberOfMessages = 10;
    }).ConfigureAwait(false);
    foreach (var response in responses)
    {
        // do something with the response
    }
}

About

WBPA.Amazon.SimpleQueueService

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages