Getting Started
Architecture
NServiceBus
Transports
Persistence
ServiceInsight
ServicePulse
ServiceControl
Monitoring
Samples

AWS local development using LocalStack

LocalStack is a tool to develop and test your AWS applications locally, reducing development time and increasing productivity.

To configure an NServiceBus endpoint to connect to LocalStack instead of AWS, the AWS endpoint URL must be set to the address of the LocalStack instance. The simplest way is by defining the AWS_ENDPOINT_URL environment variable and setting its value to the LocalStack URL:

AWS_ENDPOINT_URL=http://localhost.localstack.cloud:4566

Alternatively, configure the AWS SDK ServiceURL configuration property, like in the following example programmatically for the Amazon SQS transport:

var amazonSqsConfig = new AmazonSQSConfig();
amazonSqsConfig.ServiceURL = "http://localhost.localstack.cloud:4566";
var amazonSqsClient = new AmazonSQSClient(amazonSqsConfig);

Similarly, the Amazon SNS and DynamoDB configurations must follow the same patter. The following snippet shows the SNS configuration:

var amazonSnsConfig = new AmazonSimpleNotificationServiceConfig();
amazonSnsConfig.ServiceURL = "http://localhost.localstack.cloud:4566";
var amazonSnsClient = new AmazonSimpleNotificationServiceClient(amazonSnsConfig);

The DynamoDB configuration is shown in the following example:

var amazonDynamoDBConfig = new AmazonDynamoDBConfig();
amazonDynamoDBConfig.ServiceURL = "http://localhost.localstack.cloud:4566";
var amazonDynamoDBClient = new AmazonDynamoDBClient(amazonDynamoDBConfig);