public void Handle(SagaMessage1 message) { if (message.Num == 0 && string.IsNullOrEmpty(MessageBusContext.CurrentMessage.CorrelationId)) { log.Info("This is an example how to handle a message without creating a new saga"); SetCompleted(); return; } log.Info("SagaMessage1 arrived to saga {0}", Id); Data.Last = DateTime.Now; Data.Collected.Add(message.Num); System.Threading.Thread.Sleep(1000); }
public static void SagaTest1() { SagaStateHelper hh = new SagaStateHelper(); var repo = new Mock <ISagaRepository>(); hh.SagaStateRepo = repo.Object; hh.UseDbRecordLocking = true; var m = new SagaMessage1 { Id = "T1" }; var sh = new TestSaga(); hh.DispatchToSaga(null, m, true, true, sh, sb => { }); }