public static AmazonSqsTransport CreateTransport(string inputQueueAddress, TimeSpan peeklockDuration, AmazonSQSTransportOptions options = null) { var connectionInfo = ConnectionInfo; var amazonSqsConfig = new AmazonSQSConfig { RegionEndpoint = connectionInfo.RegionEndpoint }; var consoleLoggerFactory = new ConsoleLoggerFactory(false); var credentials = new BasicAWSCredentials(connectionInfo.AccessKeyId, connectionInfo.SecretAccessKey); options ??= new AmazonSQSTransportOptions(); options.ClientFactory = () => new AmazonSQSClient(credentials, amazonSqsConfig); var transport = new AmazonSqsTransport( inputQueueAddress, consoleLoggerFactory, new TplAsyncTaskFactory(consoleLoggerFactory), options, new DefaultRebusTime() ); transport.Initialize(peeklockDuration); transport.Purge(); return(transport); }
static AmazonSqsTransport CreateTransport(string inputQueueAddress, TimeSpan peeklockDuration) { var transport = new AmazonSqsTransport(inputQueueAddress, ConnectionInfo.AccessKeyId, ConnectionInfo.SecretAccessKey, RegionEndpoint.GetBySystemName(ConnectionInfo.RegionEndpoint)); transport.Initialize(peeklockDuration); transport.Purge(); return transport; }
static AmazonSqsTransport CreateTransport(string inputQueueAddress, TimeSpan peeklockDuration) { var transport = new AmazonSqsTransport(inputQueueAddress, ConnectionInfo.AccessKeyId, ConnectionInfo.SecretAccessKey, RegionEndpoint.GetBySystemName(ConnectionInfo.RegionEndpoint), new ConsoleLoggerFactory(false)); transport.Initialize(peeklockDuration); transport.Purge(); return(transport); }
public ITransport Create(string inputQueueAddress, TimeSpan peeklockDuration) { return(_queuesToDelete.GetOrAdd(inputQueueAddress, () => { var transport = new AmazonSqsTransport(inputQueueAddress, ConnectionInfo.AccessKeyId, ConnectionInfo.SecretAccessKey, RegionEndpoint.GetBySystemName(ConnectionInfo.RegionEndpoint)); transport.Initialize(peeklockDuration); transport.Purge(); return transport; })); }
static AmazonSqsTransport CreateTransport(string inputQueueAddress, TimeSpan peeklockDuration) { var region = RegionEndpoint.GetBySystemName(ConnectionInfo.RegionEndpoint); var consoleLoggerFactory = new ConsoleLoggerFactory(false); var transport = new AmazonSqsTransport(inputQueueAddress, ConnectionInfo.AccessKeyId, ConnectionInfo.SecretAccessKey, region, consoleLoggerFactory, new TplAsyncTaskFactory(consoleLoggerFactory)); transport.Initialize(peeklockDuration); transport.Purge(); return transport; }
public ITransport Create(string inputQueueAddress, TimeSpan peeklockDuration) { return _queuesToDelete.GetOrAdd(inputQueueAddress, () => { var transport = new AmazonSqsTransport(inputQueueAddress, ConnectionInfo.AccessKeyId, ConnectionInfo.SecretAccessKey, RegionEndpoint.GetBySystemName(ConnectionInfo.RegionEndpoint)); transport.Initialize(peeklockDuration); transport.Purge(); return transport; }); }
public static void PurgeQueue(string queueName) { var consoleLoggerFactory = new ConsoleLoggerFactory(false); var connectionInfo = AmazonSqsTransportFactory.ConnectionInfo; var amazonSqsConfig = new AmazonSQSConfig { RegionEndpoint = connectionInfo.RegionEndpoint }; var transport = new AmazonSqsTransport(new AmazonInternalSettings(consoleLoggerFactory, new TplAsyncTaskFactory(consoleLoggerFactory)) { InputQueueAddress = queueName, AmazonSqsConfig = amazonSqsConfig }); transport.Initialize(); transport.Purge(); }
static AmazonSqsTransport CreateTransport(string inputQueueAddress, TimeSpan peeklockDuration) { var amazonSqsConfig = new AmazonSQSConfig { RegionEndpoint = RegionEndpoint.GetBySystemName(ConnectionInfo.RegionEndpoint) }; var consoleLoggerFactory = new ConsoleLoggerFactory(false); var transport = new AmazonSqsTransport(inputQueueAddress, ConnectionInfo.AccessKeyId, ConnectionInfo.SecretAccessKey, amazonSqsConfig, consoleLoggerFactory, new TplAsyncTaskFactory(consoleLoggerFactory)); transport.Initialize(peeklockDuration); transport.Purge(); return(transport); }
public static AmazonSqsTransport CreateTransport(string inputQueueAddress, TimeSpan peeklockDuration, AmazonSnsAndSqsTransportOptions options = null) { var connectionInfo = ConnectionInfo; var amazonSqsConfig = new AmazonSQSConfig { RegionEndpoint = connectionInfo.RegionEndpoint }; var consoleLoggerFactory = new ConsoleLoggerFactory(false); var transport = new AmazonSqsTransport(new AmazonInternalSettings(consoleLoggerFactory, new TplAsyncTaskFactory(consoleLoggerFactory), new FailbackAmazonCredentialsFactory()) { InputQueueAddress = inputQueueAddress, AmazonSqsConfig = amazonSqsConfig, AmazonSnsAndSqsTransportOptions = options ?? new AmazonSnsAndSqsTransportOptions(), AmazonSimpleNotificationServiceConfig = new AmazonSimpleNotificationServiceConfig(), MessageSerializer = new AmazonTransportMessageSerializer() }); transport.Initialize(peeklockDuration); return(transport); }