Пример #1
0
 private void HandleReadError(string error)
 {
     lock (_lock) {
         _faulted = true;
         Log.Error("A non-recoverable error has occurred in persistent subscription {subscriptionId} : {error}. Dropping all connected clients.",
                   _settings.SubscriptionId, error);
         var clients = _pushClients.GetAll().ToArray();
         foreach (var client in clients)
         {
             _pushClients.RemoveClientByCorrelationId(client.CorrelationId, true);
         }
     }
 }
Пример #2
0
        public void RemoveClientByCorrelationId(Guid correlationId, bool sendDropNotification)
        {
            lock (_lock) {
                var lostMessages = _pushClients.RemoveClientByCorrelationId(correlationId, sendDropNotification)
                                   .OrderBy(v => v.OriginalEventNumber);
                foreach (var m in lostMessages)
                {
                    RetryMessage(m, 0);
                }

                TryPushingMessagesToClients();
            }
        }