예제 #1
0
        public void EnsureQueueAndErrorQueueExistAndAllAttributesAreUpdated(SqsBasicConfiguration queueConfig)
        {
            if (!Exists())
            {
                Create(queueConfig);
            }
            else
            {
                UpdateQueueAttribute(queueConfig);
            }

            //Create an error queue for existing queues if they don't already have one
            if (ErrorQueue != null)
            {
                var errorQueueConfig = new SqsReadConfiguration(SubscriptionType.ToTopic)
                {
                    ErrorQueueRetentionPeriodSeconds = queueConfig.ErrorQueueRetentionPeriodSeconds,
                    ErrorQueueOptOut = true
                };
                if (!ErrorQueue.Exists())
                {
                    ErrorQueue.Create(errorQueueConfig);
                }
                else
                {
                    ErrorQueue.UpdateQueueAttribute(errorQueueConfig);
                }
            }
            UpdateRedrivePolicy(new RedrivePolicy(queueConfig.RetryCountBeforeSendingToErrorQueue, ErrorQueue.Arn));
        }
예제 #2
0
 public override bool Create(SqsBasicConfiguration queueConfig, int attempt = 0)
 {
     if (!ErrorQueue.Exists())
     {
         ErrorQueue.Create(new SqsBasicConfiguration {
             ErrorQueueRetentionPeriodSeconds = queueConfig.ErrorQueueRetentionPeriodSeconds, ErrorQueueOptOut = true
         });
     }
     return(base.Create(queueConfig, attempt));
 }