/// <summary>
        /// Obtiene los mensajes
        /// </summary>
        /// <returns></returns>
        public EstrategiaDTO GetMessages(string queueName)
        {
            var conn = ConnectionRabbitMQ();

            var            channel = conn.CreateModel();
            bool           noAck   = true;
            BasicGetResult result  = channel.BasicGet(queueName, noAck);

            if (result == null)
            {
                // No message available at this time.
            }
            else
            {
                IBasicProperties props      = result.BasicProperties;
                byte[]           body       = result.Body;
                var           base64Decoded = Encoding.UTF8.GetString(body);
                EstrategiaDTO estrategia    = JsonConvert.DeserializeObject <EstrategiaDTO>(base64Decoded);

                ControllerVulkano.ScriptController scriptController = new ControllerVulkano.ScriptController();

                if (estrategia != null)
                {
                    var script = scriptController.SelectScript(estrategia.TipoPruebas.First().ID);
                    estrategia.TipoPruebas.First().Script = script;
                    //channel.BasicAck(result.DeliveryTag, false);
                }
                return(estrategia);
            }
            return(null);
        }
Beispiel #2
0
 public ReturnMessage Put([FromBody] ScriptDTO script)
 {
     ControllerVulkano.ScriptController scriptController = new ControllerVulkano.ScriptController();
     return(scriptController.UpdateScript(script));
 }