private async static void AddPushRequestToQueue(string message)
 {
     Guid applicationId = Guid.NewGuid(); //one for an application
     Guid busId         = Guid.NewGuid(); //Each instance of publishing bus
     var  rmBus         = new RabbitMqBus();
     await Task.Run(() => rmBus.SendCommand(new CreateGdmsNotificationCommand(applicationId, Guid.NewGuid(), busId)
     {
         Message = message
     }));
 }
示例#2
0
        static void Main(string[] args)
        {
            Guid applicationId = Guid.NewGuid(); //one for an application
            Guid busId         = Guid.NewGuid(); //Each instance of publishing bus
            var  msg           = Console.ReadLine();

            while (msg != "Q")
            {
                var commandMessage = msg;
                var rmBus          = new RabbitMqBus();
                rmBus.SendCommand(new SendEmailCommand()
                {
                    Message = commandMessage
                });


                Console.WriteLine("published");
                msg = Console.ReadLine();
            }
            Console.ReadKey();
        }