private void NackMessage(HttpEntityManager http, UriTemplateMatch match) { if (_httpForwarder.ForwardRequest(http)) { return; } var envelope = new NoopEnvelope(); var groupname = match.BoundVariables["subscription"]; var stream = match.BoundVariables["stream"]; var messageId = match.BoundVariables["messageId"]; var nakAction = GetNackAction(http, match); var id = Guid.NewGuid(); if (!Guid.TryParse(messageId, out id)) { http.ReplyStatus(HttpStatusCode.BadRequest, "messageid should be a properly formed guid", exception => { }); return; } var cmd = new ClientMessage.PersistentSubscriptionNackEvents( Guid.NewGuid(), Guid.NewGuid(), envelope, BuildSubscriptionGroupKey(stream, groupname), "Nacked from HTTP", nakAction, new[] { id }, http.User); Publish(cmd); http.ReplyStatus(HttpStatusCode.Accepted, "", exception => { }); }
private void NackMessages(HttpEntityManager http, UriTemplateMatch match) { var envelope = new NoopEnvelope(); var groupname = match.BoundVariables["subscription"]; var stream = match.BoundVariables["stream"]; var messageIds = match.BoundVariables["messageIds"]; var nakAction = GetNackAction(http, match); var ids = new List <Guid>(); foreach (var messageId in messageIds.Split(new[] { ',' })) { Guid id; if (!Guid.TryParse(messageId, out id)) { http.ReplyStatus(HttpStatusCode.BadRequest, "messageid should be a properly formed guid", exception => { }); return; } ids.Add(id); } var cmd = new ClientMessage.PersistentSubscriptionNackEvents( Guid.NewGuid(), Guid.NewGuid(), envelope, BuildSubscriptionGroupKey(stream, groupname), "Nacked from HTTP", nakAction, ids.ToArray(), http.User); Publish(cmd); http.ReplyStatus(HttpStatusCode.Accepted, "", exception => { }); }
public void Handle(ClientMessage.PersistentSubscriptionNackEvents message) { if (!_started) { return; } PersistentSubscription subscription; if (_subscriptionsById.TryGetValue(message.SubscriptionId, out subscription)) { subscription.NotAcknowledgeMessagesProcessed(message.CorrelationId, message.ProcessedEventIds, (NakAction)message.Action, message.Message); } }