Beispiel #1
0
 private static void TestSetupNormalQueue()
 {
     RabbitSetupTest.CreateExchangesAndQueues();
     Global.DefaultWatcher.InfoFormat("Press anykey to publish messages ...");
     Console.ReadKey(false);
     PublishingTest.Publish(2, 5000);
     Global.DefaultWatcher.InfoFormat("If you check queue Burrow.Queue.BurrowTestApp.Bunny, you should see 10K msgs there");
     Console.WriteLine();
     Global.DefaultWatcher.InfoFormat("Now press anykey to destroy the queue and exchange");
     Console.ReadKey(false);
     RabbitSetupTest.DestroyExchangesAndQueues();
     Global.DefaultWatcher.InfoFormat("Queue Burrow.Queue.BurrowTestApp.Bunny and exchange Burrow.Exchange should be deleted now");
     Console.ReadKey(false);
 }
Beispiel #2
0
        /// <summary>
        /// Run this test if you have RabbitMQ installed on localhost, otherwise change the connection string in app.config
        /// </summary>
        /// <param name="args"></param>
        static void Main(string[] args)
        {
            Global.DefaultSerializer = new JsonSerializer();
            PublishingTest.PrintHelp();

            #region -- Run this test to create and destroy exchange, queues programatically --
            RabbitSetupTest.CreateExchangesAndQueues();
            //Console.Write("Press anykey to destroy them!");
            //Console.ReadKey();
            //RabbitSetupTest.DestroyExchangesAndQueues();


            //RabbitSetupTest.CreateExchangesAndQueues("EEEEE", "QQQQQ", "RRRRR");
            //Console.Write("Press anykey to destroy them!");
            //Console.ReadKey();
            //RabbitSetupTest.DestroyExchangesAndQueues("EEEEE", "QQQQQ");
            //RabbitSetupTest.DestroyExchangesAndQueues("Burrow.Exchange.Error", "Burrow.Queue.Error");
            #endregion

            #region -- Run this test to create and destroy PRIORITY exchange, queues programatically --
            //PriorityRabbitSetupTest.CreateExchangesAndQueues();
            //Console.Write("Press anykey to destroy them!");
            //Console.ReadKey();
            //PriorityRabbitSetupTest.DestroyExchangesAndQueues();
            #endregion


            #region -- Run this test to publish normal messages to queue --
            Console.WriteLine("Press anykey to publish messages ..."); Console.ReadKey();
            PublishingTest.Publish(2, 1000);
            #endregion

            #region -- Run this test to publish PRIORITY messages to queue --
            //Console.WriteLine("Press anykey to publish messages ..."); Console.ReadKey();
            //PublishingTest.PublishRandomPriorityMessages(3);
            #endregion


            Console.WriteLine("Finished. Press anykey to quit!");
            Console.ReadKey();
        }