public ITransport Create(string inputQueueAddress, TimeSpan peeklockDuration, AmazonSQSTransportOptions options = null)
        {
            if (inputQueueAddress == null)
            {
                // one-way client
                var transport = CreateTransport(null, peeklockDuration, options);
                _disposables.Push(transport);
                return(transport);
            }

            return(_queuesToDelete.GetOrAdd(inputQueueAddress, () =>
            {
                var amazonSQSTransport = CreateTransport(inputQueueAddress, peeklockDuration, options);
                _disposables.Push(amazonSQSTransport);
                return amazonSQSTransport;
            }));
        }
Exemplo n.º 2
0
        public static AmazonSqsTransport CreateTransport(string inputQueueAddress, TimeSpan peeklockDuration, AmazonSQSTransportOptions options = null)
        {
            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),
                                                              options);

            transport.Initialize(peeklockDuration);
            transport.Purge();
            return(transport);
        }
        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);
        }
Exemplo n.º 4
0
        public ITransport Create(string inputQueueAddress, TimeSpan peeklockDuration, AmazonSQSTransportOptions options = null)
        {
            if (inputQueueAddress == null)
            {
                return(CreateTransport(inputQueueAddress, peeklockDuration, options));
            }

            return(_queuesToDelete.GetOrAdd(inputQueueAddress, () => CreateTransport(inputQueueAddress, peeklockDuration, options)));
        }