private void HandleNackedMessage(NakAction action, Guid id, string reason) { OutstandingMessage e; switch (action) { case NakAction.Retry: case NakAction.Unknown: if (_outstandingMessages.GetMessageById(id, out e)) { if (!ActionTakenForRetriedMessage(e)) { RetryMessage(e.ResolvedEvent, e.RetryCount); } } break; case NakAction.Park: if (_outstandingMessages.GetMessageById(id, out e)) { ParkMessage(e.ResolvedEvent, "Client explicitly NAK'ed message.\n" + reason, 0); } break; case NakAction.Stop: StopSubscription(); break; case NakAction.Skip: SkipMessage(id); break; default: SkipMessage(id); break; } }
private static ClientMessages.NakAction GetNackAction(HttpEntityManager manager, UriTemplateMatch match, NakAction nakAction = NakAction.Unknown) { var rawValue = match.BoundVariables["action"] ?? string.Empty; switch (rawValue.ToLowerInvariant()) { case "park": return ClientMessages.NakAction.Park; case "retry": return ClientMessages.NakAction.Retry; case "skip": return ClientMessages.NakAction.Skip; case "stop": return ClientMessages.NakAction.Stop; default: return ClientMessages.NakAction.Unknown; } }
private static ClientMessages.NakAction GetNackAction(HttpEntityManager manager, UriTemplateMatch match, NakAction nakAction = NakAction.Unknown) { var rawValue = match.BoundVariables["action"] ?? string.Empty; switch (rawValue.ToLowerInvariant()) { case "park": return(ClientMessages.NakAction.Park); case "retry": return(ClientMessages.NakAction.Retry); case "skip": return(ClientMessages.NakAction.Skip); case "stop": return(ClientMessages.NakAction.Stop); default: return(ClientMessages.NakAction.Unknown); } }
private void HandleNakedMessage(NakAction action, Guid id, string reason) { OutstandingMessage e; switch (action) { case NakAction.Retry: case NakAction.Unknown: if (_outstandingMessages.GetMessageById(id, out e)) { if (!ActionTakenForRetriedMessage(e)) { RetryMessage(e.ResolvedEvent, e.RetryCount); } } break; case NakAction.Park: if (_outstandingMessages.GetMessageById(id, out e)) { ParkMessage(e.ResolvedEvent, "Client explicitly NAK'ed message.\n" + reason, 0); } break; case NakAction.Stop: StopSubscription(); break; case NakAction.Skip: SkipMessage(id); break; default: SkipMessage(id); break; } }
public void NotAcknowledgeMessagesProcessed(Guid correlationId, Guid[] processedEventIds, NakAction action, string reason) { lock (_lock) { foreach (var id in processedEventIds) { Log.Info("Message NAK'ed id {0} action to take {1} reason '{2}'", id, action, reason ?? ""); HandleNakedMessage(action, id, reason); } RemoveProcessingMessages(correlationId, processedEventIds); TryMarkCheckpoint(false); TryReadingNewBatch(); TryPushingMessagesToClients(); } }
public PersistentSubscriptionNackEvents(Guid internalCorrId, Guid correlationId, IEnvelope envelope, string subscriptionId, string message, NakAction action, Guid[] processedEventIds, IPrincipal user) : base(internalCorrId, correlationId, envelope, user) { SubscriptionId = subscriptionId; ProcessedEventIds = processedEventIds; Message = message; Action = action; }