# 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: ```cs var transport = endpointConfiguration.UseTransport(); ``` Use: ```cs var transport = new SqsTransport(); endpointConfiguration.UseTransport(transport); ``` > [!NOTE] > The existing API surface with `UseTransport()` is supported via a [shim API](https://en.wikipedia.org/wiki/Shim_(computing)) to ease migration. However, it is recommended to switch to the new transport configuration API to prepare for future upgrades of NServiceBus. ## SDK clients Customizing instances of the SQS and SNS SDK clients is now done via the `SqsTransport` constructor. Instead of: ```cs var transport = endpointConfiguration.UseTransport(); transport.ClientFactory(() => new AmazonSQSClient()); transport.ClientFactory(() => new AmazonSimpleNotificationServiceClient()); ``` Use: ```cs 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. > [!NOTE] > By default, the value is `null` which means S3 usage for sending large messages is disabled. Instead of: ```cs var transport = endpointConfiguration.UseTransport(); var s3Configuration = transport.S3("nsb-sqs-messages", "my/sample/path"); s3Configuration.ClientFactory(() => new AmazonS3Client()); ``` Use: ```cs 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. > [!NOTE] > By default, the value is `null` which means the messages are not encrypted. Instead of: ```cs var transport = endpointConfiguration.UseTransport(); var s3Configuration = transport.S3(bucketName, keyPrefix); s3Configuration.ServerSideEncryption(ServerSideEncryptionMethod.AES256, keyManagementServiceKeyId: "MyKeyId"); ``` Use: ```cs var transport = new SqsTransport { S3 = new S3Settings(bucketName, keyPrefix) { Encryption = new S3EncryptionWithManagedKey(ServerSideEncryptionMethod.AES256, "keyId") } }; endpointConfiguration.UseTransport(transport); ```