Пример #1
0
        static void Main(string[] args)
        {
            var rabbitMqProxy = new RabbitMqService(new MqConfig
            {
                AutomaticRecoveryEnabled = true,
                HeartBeat = 60,
                NetworkRecoveryInterval = new TimeSpan(60),
                Host     = "localhost",
                UserName = "******",
                Password = "******"
            });

            var input = Input();

            while (input != "exit")
            {
                var rpcMsgModel = new RpcMsgModel
                {
                    CreateDateTime = DateTime.Now,
                    Msg            = input
                };

                var result = rabbitMqProxy.RpcClient(rpcMsgModel);

                Console.WriteLine(result);

                input = Input();
            }

            rabbitMqProxy.Dispose();
        }