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 Tests()
        {
            var source = new ResourceValidatorSource(GetType().Assembly, "Testing.PostTest.Xunit.Schemas.{messageType}.json");

            _queue  = new InMemoryMessageReader();
            _output = new InMemoryValidationOutput();

            _monitor = new QueueMonitor(_queue, new DirectMessageConverter(), new MessageValidator(source), _output);
            _monitor.Start();
        }