static void Main(string[] args) { var rabbitOptions = new RabbitOptions { HostName = RabbitHostName, ExchangeName = RabbitExchangeName, ExchangeAutoDelete = true, ExchangeDurable = false }; var reader = new RabbitMessageReader(rabbitOptions); var converter = new RabbitMessageConverter(); var source = new ResourceValidatorSource(typeof(Program).Assembly, "Console.Rabbit.Schemas.{messageType}.json"); var output = new ConsoleValidationOutput(); var monitor = new QueueMonitor(reader, converter, new MessageValidator(source), output); monitor.Start(); var publisher = new Publisher(RabbitHostName, RabbitExchangeName); publisher.Start(); System.Console.WriteLine("Monitoring {0} on {1}. Press any key to stop.", rabbitOptions.ExchangeName, rabbitOptions.HostName); System.Console.ReadKey(); System.Console.WriteLine("Stopping..."); publisher.Stop(); monitor.Stop(); }
public void Dispose() { _monitor.Stop(); foreach (var result in _output.Results) { result.Status.ShouldBe(Status.Pass); } }
protected override void OnStop() { _monitor.Stop(); }