示例#1
0
        public JsonResult SendCommandMessageMq(string message, string user)
        {
            var         obj  = new Queue.RabbitMQ();
            IConnection con  = obj.GetConnection();
            var         flag = obj.Send(con, message, user);

            return(Json(null));
        }
示例#2
0
 public JsonResult ReceiveCommandMessageMq()
 {
     try
     {
         var obj       = new Queue.RabbitMQ();
         var con       = obj.GetConnection();
         var userQueue = _session.CurrentUser.ID.ToString();
         var data      = obj.Receive(con, userQueue);
         var message   = JsonConvert.DeserializeObject <Message>(data);
         message.Text = GetBotMessage();
         return(Json(message));
     }
     catch (Exception)
     {
         return(null);
     }
 }