Exemplo n.º 1
0
 private static void RunTopicsDemo(IModel model, AmqpMessagingService messagingService)
 {
     Console.WriteLine("Enter your message as follows: the routing key, followed by a semicolon, and then the message. Quit with 'q'.");
     while (true)
     {
         string fullEntry = Console.ReadLine();
         string[] parts = fullEntry.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries);
         string key = parts[0];
         string message = parts[1];
         if (message.ToLower() == "q") break;
         messagingService.SendTopicsMessage(message, key, model);
     }
 }