public AmazonSqsPollingService(
     IOptions <SuperDumpSettings> settings,
     SuperDumpRepository superDumpRepo,
     AmazonSqsClientService amazonSqsClientService,
     LinkGenerator linkGenerator,
     ILoggerFactory loggerFactory
     )
 {
     this.amazonSqsSettings      = settings.Value.AmazonSqsSettings;
     this.superDumpRepo          = superDumpRepo;
     this.amazonSqsClientService = amazonSqsClientService;
     this.linkGenerator          = linkGenerator;
     this.logger  = loggerFactory.CreateLogger <AmazonSqsPollingService>();
     this.baseUri = new Uri(amazonSqsSettings.SuperDumpBaseUrl);
 }
Example #2
0
        public AmazonSqsService(IOptions <SuperDumpSettings> settings, SuperDumpRepository superDumpRepo, LinkGenerator linkGenerator, ILoggerFactory loggerFactory)
        {
            this.amazonSqsSettings = settings.Value.AmazonSqsSettings;
            this.superDumpRepo     = superDumpRepo;
            this.linkGenerator     = linkGenerator;

            this.logger = loggerFactory.CreateLogger <AmazonSqsService>();

            var credentials = new BasicAWSCredentials(amazonSqsSettings.AccessKey, amazonSqsSettings.SecretKey);
            var config      = new AmazonSQSConfig {
                RegionEndpoint = RegionEndpoint.GetBySystemName(amazonSqsSettings.Region)
            };

            this.sqsClient = new AmazonSQSClient(credentials, config);

            this.baseUri = new Uri(amazonSqsSettings.SuperDumpBaseUrl);
        }