Exemple #1
0
        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();
        }
Exemple #2
0
 public void Dispose()
 {
     _monitor.Stop();
     foreach (var result in _output.Results)
     {
         result.Status.ShouldBe(Status.Pass);
     }
 }
Exemple #3
0
 protected override void OnStop()
 {
     _monitor.Stop();
 }