Getting Started
Architecture
NServiceBus
Persistence
ServiceInsight
ServicePulse
ServiceControl
Monitoring
Samples

AmazonSQS Transport Upgrade Version 5 to 6

Delayed delivery

The unrestricted delayed delivery is now always enabled so the UnrestrictedDurationDelayedDelivery() API has been deprecated.

Configuring the SQS transport

To use the SQS transport for NServiceBus, create a new SqsTransport instance and pass it to EndpointConfiguration.UseTransport.

Instead of:

var transport = endpointConfiguration.UseTransport<SqsTransport>();

Use:

var transport = new SqsTransport();

endpointConfiguration.UseTransport(transport);

SDK clients

Customizing instances of the SQS and SNS SDK clients is now done via the SqsTransport constructor.

Instead of:

var transport = endpointConfiguration.UseTransport<SqsTransport>();

transport.ClientFactory(() => new AmazonSQSClient());
transport.ClientFactory(() => new AmazonSimpleNotificationServiceClient());

Use:

var transport = new SqsTransport(
    new AmazonSQSClient(),
    new AmazonSimpleNotificationServiceClient());

endpointConfiguration.UseTransport(transport);

S3 configuration

Enabling S3 for handling large messages is now configured via the S3 property of the transport definition.

Instead of:

var transport = endpointConfiguration.UseTransport<SqsTransport>();
var s3Configuration = transport.S3("nsb-sqs-messages", "my/sample/path");

s3Configuration.ClientFactory(() => new AmazonS3Client());

Use:

var transport = new SqsTransport
{
    S3 = new S3Settings(
        bucketForLargeMessages: "nsb-sqs-messages",
        keyPrefix: "my/sample/path",
        s3Client: new AmazonS3Client())
};

endpointConfiguration.UseTransport(transport);

Encryption

Message payload encryption is now configured via the Encryption property of the S3 settings object.

Instead of:

var transport = endpointConfiguration.UseTransport<SqsTransport>();
var s3Configuration = transport.S3(bucketName, keyPrefix);

s3Configuration.ServerSideEncryption(ServerSideEncryptionMethod.AES256, keyManagementServiceKeyId: "MyKeyId");

Use:

var transport = new SqsTransport
{
    S3 = new S3Settings(bucketName, keyPrefix)
    {
        Encryption = new S3EncryptionWithManagedKey(ServerSideEncryptionMethod.AES256, "keyId")
    }
};

endpointConfiguration.UseTransport(transport);