Exemplo n.º 1
0
        static void Main(string[] args)
        {
            RabbitMqConfiguration configuration = new RabbitMqConfiguration();
            MsgPublisher          publisher     = new MsgPublisher(configuration);

            publisher.Publish("Hello...");
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            MsgPublisher publisher = new MsgPublisher();

            while (true)
            {
                Console.WriteLine("请输入要发布的消息:");
                string msg = Console.ReadLine();
                publisher.Publish(msg);

                publisher.Publish(msg, "Second");
                Console.WriteLine("消息发布成!");
            }
        }