public void Handle(RetryAllInGroup message)
        {
            if (Retries == null)
            {
                log.Warn($"Attempt to retry a group ({message.GroupId}) when retries are disabled");
                return;
            }

            if (ArchivingManager.IsArchiveInProgressFor(message.GroupId))
            {
                log.Warn($"Attempt to retry a group ({message.GroupId}) which is currently in the process of being archived");
                return;
            }

            FailureGroupView group;

            using (var session = Store.OpenSession())
            {
                group = session.Query <FailureGroupView, FailureGroupsViewIndex>()
                        .FirstOrDefault(x => x.Id == message.GroupId);
            }

            string originator = null;

            if (@group?.Title != null)
            {
                originator = group.Title;
            }

            var started = message.Started ?? DateTime.UtcNow;

            RetryingManager.Wait(message.GroupId, RetryType.FailureGroup, started, originator, group?.Type, group?.Last);
            Retries.StartRetryForIndex <FailureGroupMessageView, FailedMessages_ByGroup>(message.GroupId, RetryType.FailureGroup, started, x => x.FailureGroupId == message.GroupId, originator, group?.Type);
        }
 public ArchiveAllInGroupHandler(IDocumentStore store, IDomainEvents domainEvents, ArchiveDocumentManager documentManager, ArchivingManager archiveOperationManager, RetryingManager retryingManager)
 {
     this.store                   = store;
     this.documentManager         = documentManager;
     this.archiveOperationManager = archiveOperationManager;
     this.retryingManager         = retryingManager;
     this.domainEvents            = domainEvents;
 }
 public ArchiveAllInGroupHandler(IBus bus, IDocumentStore store, ArchiveDocumentManager documentManager, ArchivingManager archiveOperationManager, RetryingManager retryingManager)
 {
     this.bus                     = bus;
     this.store                   = store;
     this.documentManager         = documentManager;
     this.archiveOperationManager = archiveOperationManager;
     this.retryingManager         = retryingManager;
 }
 public RetryProcessor(IDocumentStore store, IDispatchMessages sender, IDomainEvents domainEvents, ReturnToSenderDequeuer returnToSender, RetryingManager retryingManager)
 {
     this.store                     = store;
     this.sender                    = sender;
     this.returnToSender            = returnToSender;
     this.retryingManager           = retryingManager;
     this.domainEvents              = domainEvents;
     corruptedReplyToHeaderStrategy = new CorruptedReplyToHeaderStrategy(RuntimeEnvironment.MachineName);
 }
Пример #5
0
 public GroupFetcher(RetryingManager retryingManager, ArchivingManager archivingManager)
 {
     this.retryingManager  = retryingManager;
     this.archivingManager = archivingManager;
 }
Пример #6
0
 public RetryProcessor(ISendMessages sender, IBus bus, ReturnToSenderDequeuer returnToSender, RetryingManager retryingManager)
 {
     this.sender                    = sender;
     this.bus                       = bus;
     this.returnToSender            = returnToSender;
     this.retryingManager           = retryingManager;
     corruptedReplyToHeaderStrategy = new CorruptedReplyToHeaderStrategy(RuntimeEnvironment.MachineName);
 }