Пример #1
0
        public IHttpActionResult Post(SendAcknowledgementCommand sendAcknowledgementCommand)
        {
            if (!sendAcknowledgementCommand.Success)
            {
                Console.WriteLine("received remote acknowledgment of failed insert. Log and send email");
                return(Ok());
            }

            //write to db syncronously - async will not guarentee
            completionService.CompleteCorrelatedMessages(sendAcknowledgementCommand.CorrelationId);

            //using a command as it is in a web thread
            bus.Send(new CompleteAgreementSagaCommand {
                CorrelationId = sendAcknowledgementCommand.CorrelationId
            });

            return(Ok());
        }
 public void Handle(CompletionAuditMessage message)
 {
     completionService.CompleteCorrelatedMessages(message.CorrelationId);
 }