Ejemplo n.º 1
0
 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;
     }
 }
Ejemplo n.º 3
0
        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);
            }
        }
Ejemplo n.º 4
0
 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;
     }
 }
Ejemplo n.º 5
0
 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();
     }
 }
Ejemplo n.º 6
0
 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();
     }
 }
Ejemplo n.º 7
0
 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;
 }