예제 #1
0
 static void Main(string[] args)
 {
     Console.WriteLine("Rabbit MQ Console Application!");
     RabbitMQ_Fanout.RunExample();
     RabbitMQ_Direct.RunExample();
     RabbitMQ_Topic.RunExample();
     RabbitMQ_AlternateQueue.RunExample();
 }
        public static void RunExample()
        {
            // Receive messages
            using (RabbitMQ_Topic rabbitMQHelper = new RabbitMQ_Topic())
            {
                rabbitMQHelper.PublishMessage(EXCHANGE_NAME, "Hi there, how are you?", "convert.image.bpm");
                rabbitMQHelper.PublishMessage(EXCHANGE_NAME, "Are you there? There is a problem!", "convert.bitmap.image");
                rabbitMQHelper.PublishMessage(EXCHANGE_NAME, "The server is down!! Please come here inmediatly!", "image.bitmap.32bit");

                rabbitMQHelper.ActiveListeninFromQueue(RabbitMQ_Topic.QUEUE_NAME_1);
                rabbitMQHelper.ActiveListeninFromQueue(RabbitMQ_Topic.QUEUE_NAME_2);
                rabbitMQHelper.ActiveListeninFromQueue(RabbitMQ_Topic.QUEUE_NAME_3);
                Console.WriteLine("Press any key to continue...");
                Console.ReadLine();
            }
        }