Table of Contents

Class AmazonEventBusOptions<TMarker>

Namespace
Savvyio.Extensions.DependencyInjection.SimpleQueueService.EventDriven
Assembly
Savvyio.Extensions.DependencyInjection.SimpleQueueService.dll

Configuration options for AmazonEventBus<TMarker>.

public class AmazonEventBusOptions<TMarker> : AmazonEventBusOptions, IValidatableParameterObject, IParameterObject, IDependencyInjectionMarker<TMarker>

Type Parameters

TMarker
Inheritance
AmazonEventBusOptions<TMarker>
Implements
Inherited Members

Examples

AmazonEventBusOptions<TMarker> configures the DI-registered SNS/SQS event bus with AWS credentials and the source queue URL. The options are passed through the AddAmazonEventBus setup delegate.

using System;
using Amazon;
using Amazon.Runtime;
using Microsoft.Extensions.DependencyInjection;
using Savvyio.Extensions.DependencyInjection.SimpleQueueService;
using Savvyio.Extensions.SimpleQueueService.EventDriven;

namespace ExampleApp;

public class DiEventBusRegistration
{
    public static AmazonEventBusOptions CreateAndInspect()
    {
        var options = new AmazonEventBusOptions
        {
            Credentials = new AnonymousAWSCredentials(),
            Endpoint = RegionEndpoint.EUWest1,
            SourceQueue = new Uri("https://sqs.eu-west-1.amazonaws.com/123456789012/events")
        };
        Console.WriteLine($"Event queue: {options.SourceQueue}");
        return options;
    }
}

See Also