public TransportInfrastructure(ReadOnlySettings settings) { configuration = new TransportConfiguration(settings); try { sqsClient = configuration.SqsClientFactory(); } catch (AmazonClientException e) { var message = "Unable to configure the SQS client. Make sure the environment variables for AWS_REGION, AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY are set or the client factory configures the created client accordingly"; Logger.Error(message, e); throw new Exception(message, e); } try { if (!string.IsNullOrEmpty(settings.GetOrDefault <string>(SettingsKeys.S3BucketForLargeMessages))) { s3Client = configuration.S3ClientFactory(); } } catch (AmazonClientException e) { var message = "Unable to configure the S3 client. Make sure the environment variables for AWS_REGION, AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY are set or the client factory configures the created client accordingly"; Logger.Error(message, e); throw new Exception(message, e); } queueUrlCache = new QueueUrlCache(sqsClient); }
public TransportInfrastructure(ReadOnlySettings settings) { configuration = new TransportConfiguration(settings); sqsClient = configuration.SqsClientFactory(); s3Client = configuration.S3ClientFactory(); queueUrlCache = new QueueUrlCache(sqsClient); }