Beispiel #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ChannelFactory"/> class.
 /// </summary>
 /// <param name="awsConnection">The details of the connection to AWS</param>
 /// <param name="messageConsumerFactory">The messageConsumerFactory.</param>
 public ChannelFactory(
     AWSMessagingGatewayConnection awsConnection,
     SqsMessageConsumerFactory messageConsumerFactory)
 {
     _awsConnection          = awsConnection;
     _messageConsumerFactory = messageConsumerFactory;
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="ChannelFactory"/> class.
        /// </summary>
        /// <param name="awsConnection">The details of the subscription to AWS</param>
        public ChannelFactory(
            AWSMessagingGatewayConnection awsConnection)
            : base(awsConnection)
        {
            _messageConsumerFactory = new SqsMessageConsumerFactory(awsConnection);
            var delay = Backoff.LinearBackoff(TimeSpan.FromSeconds(2), retryCount: 3, factor: 2.0, fastFirst: true);

            _retryPolicy = Policy
                           .Handle <InvalidOperationException>()
                           .WaitAndRetry(new[]
            {
                TimeSpan.FromSeconds(1),
                TimeSpan.FromSeconds(5),
                TimeSpan.FromSeconds(10)
            });
        }