Configuration Options

Target Version: NServiceBus 6.x
Standard support for version 6.x of NServiceBus has expired. For more information see our Support Policy.
The transport does not support transport.ConnectionString(...) to specify the connection string via code.



Default: EnvironmentVariables

This tells the endpoint where to find the AWS credentials. The value can be one of:

  • EnvironmentVariables: The endpoint will extract an AWS Access Key ID and AWS Secret Access Key from the environment variables AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY respectively.
  • InstanceProfile: the endpoint will use the credentials of the first EC2 role attached to the EC2 instance. This is valid only when running the endpoint on an EC2 instance.

Example: To use the credentials of an EC2 role, specify:

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



Default: None

This is the Amazon Web Services Region in which to access the SQS service. The value must be a valid AWS region code.

Example: For the Sydney region, specify

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

ProxyHost and ProxyPort


Default: Empty

This is the name of the host of the proxy server that the client must authenticate to.

Note that the username and password for the proxy can not be specified via the connection string; they are sourced from environment variables instead. The username must be set in NSERVICEBUS_AMAZONSQS_PROXY_AUTHENTICATION_USERNAME and the password must be set in NSERVICEBUS_AMAZONSQS_PROXY_AUTHENTICATION_PASSWORD.

var transport = endpointConfiguration.UseTransport<SqsTransport>();
    proxyHost: "",
    proxyPort: 8888);



Default: 4

This is the maximum number of days that a message will be retained within SQS and S3. When a sent message is not received and successfully processed within the specified time, the message will be lost. This value applies to both SQS and S3 - messages in SQS will be deleted after this amount of time, and large message bodies stored in S3 will automatically be deleted after this amount of time.

The maximum value is 14 days.

Example: To set this to the maximum value, specify:

var transport = endpointConfiguration.UseTransport<SqsTransport>();
Large message payloads stored in S3 are never deleted by the receiving endpoint, regardless of whether they were successfully handled. The S3 aging policy controls the deletion of the payload and will respect the configured TTL. Since message payloads stored in S3 are important for audited and failed messages stored in ServiceControl, it is crucial that the ServiceControl message retention period is aligned with the configured SQS and S3 TTL.



Default: None

This string value is prepended to the name of every SQS queue referenced by the endpoint. This is useful when deploying many instances of the same application in the same AWS region (e.g. a development instance, a QA instance, and a production instance), and the queue names must be distinguished from each other.

Example: For a development instance, specify:

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

For example, queue names for the endpoint called "SampleEndpoint" might be:




Default: Empty. Any attempt to send a large message with an empty S3 bucket will fail.

This is the name of an S3 Bucket that will be used to store message bodies for messages larger than 256kB in size. If this option is not specified, S3 will not be used at all. Any attempt to send a message larger than 256kB will throw an exception if a value is not supplied for this parameter.

If the specified bucket doesn't exist, it will be created when the endpoint starts.

Example: To use a bucket named nsb-sqs-messages, specify:

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



Default: Empty

This is the path within the specified S3 Bucket to store large message bodies. If this option is specified without a value for S3BucketForLargeMessages, an exception will be thrown.

Delayed Delivery

Default: enabled

SQS supports delaying message delivery by up to 15 minutes natively. This feature is enabled by default and cannot be disabled.

Attempting to delay messages longer than 15 minutes will fail.

Last modified