public ActionResult Get(string queue = "")
        {
            var obj = _messageAppService.CreateMessage(ControllerContext.RouteData.Values["controller"].ToString());

            using (IConnection connection = new ConnectionFactory().CreateConnection())
            {
                using (IModel channel = connection.CreateModel())
                {
                    channel.QueueDeclare(queue, false, false, false, null);
                    channel.BasicPublish(string.Empty, queue, null, _messageAppService.EncodeMessage(obj));
                }
            }

            return(Ok(true));
        }
Пример #2
0
 public async Task <MessageDto> CreateMessage(CreateUpdateMessageInput input)
 {
     return(await _messageAppService.CreateMessage(input));
 }
        public ActionResult GetMessage()
        {
            var obj = _messageAppService.CreateMessage(ControllerContext.RouteData.Values["controller"].ToString());

            return(Ok(_messageAppService.ReturnMessage(obj)));
        }