This is a service bus module that is based on the Amazon AWS Simple Notification Service (SNS) and Simple Queue Service (SQS). A topic will be created on SNS, while each Redakt instance will create an SQS queue that will receive broadcast messages from the SNS topic.

Installation

The SNS/SQS service bus is part of the Amazon AWS provider package. Install the package with the NuGet package manager or the Package Manager Console.

PM> Install-Package Redakt.Providers.Amazon

Service registration

Register Amazon SNS/SQS module services in the ConfigureServices() method of your project's Startup.cs file by adding an AddAwsServiceBus() call to the Redakt builder instance. The order in which services are added to the Redakt builder is not important.

public void ConfigureServices(IServiceCollection services)
{
    // ... framework and other services here

    var builder = services.AddRedakt();
    builder.AddAwsServiceBus();  // Optionally pass Action<AwsServiceBusOptions> parameter.
    // ... other Redakt services
}

Configuration settings

The Amazon SNS/SQS service bus is configured through the appsettings.json file. Any configuration that is not included in the appsettings.json file will be set to its default values. See the example below.

{
    "Redakt": {
        "ServiceBus": {
            "AwsServiceBus": {
                "AwsAccessKeyId": "<your aws access key id>",
                "AwsSecretAccessKey": "<your aws secret access key>",
                "AwsRegion": "<your aws region>",
                "TopicName": "Redakt",
                "UseFifoQueue": false
            }
        }
    }
}

Additionally, an Action<AwsServiceBusOptions> configuration delegate may be passed to the AddAwsServiceBus() call. Configuration set through this delegate takes priority and overrides values in the appsettings.json file.

Access Key Id & Secret Access Key

Required. These settings are found in the AWS Console and are used to connect to your SNS/SQS service instance. Read here how to manage and retrieve access keys for IAM users.

The Amazon S3 file storage and Amazon Dynamo DB database modules also require AWS access keys to be set. You can use the same or different access keys, depending on your needs.

Region

Required. Sets the region name for the data center that your Amazon SNS/SQS service is hosted in. This must be one of the available Amazon region codes, f.e. eu-west-1.

Topic Name

Sets the name of the SNS topic that the service bus will broadcast and read messages from. Defaults to "Redakt".

Use FIFO Queue

If set to true, configures SQS as FIFO queues.