private void TestBus(int iterations) { for (int index = 0; index < iterations; index++) { var person = Person.Create(10000 + index, "test First", "Test Last", DateTime.Now, "123-12-1233"); var querlyTicket = QuerlyTicket.Create("person", person.Id.ToString(), "add") .ToJson(); var querlyTicketJsonDocument = new JsonDocument { Body = querlyTicket }; Console.WriteLine(querlyTicketJsonDocument.Body); _bus.Send("querlydemo", querlyTicketJsonDocument); _documents.Save(person); } }
private void TestBus() { int x = 0; //while("message".Remember<string>() != null) var watch = new Stopwatch(); watch.Start(); var records = 1000; while(x < records) { _bus.Send("daemondemo", MessageOne.Create("MessageOne {0}".AsFormat(++x))); } while(Handler.total < records) { } watch.Stop(); var record = new JsonDocument() { Body = "I just sent and received like ... {0} documents in {1} seconds!".AsFormat(x, watch.Elapsed.TotalSeconds) }; "recordId".Remember(r => r.Is(record.Id)); _documents.Save(record); var message = MessageTwo.Create("This is message type two"); _bus.Send("daemondemo", message); }