Ejemplo n.º 1
0
 protected void Log(string message)
 {
     if (_loggerEnabled)
     {
         if (_logger == null)
         {
             _logger = new QueueLogger("noesis-queue-recevier");
         }
         _logger.AddMessage(message);
     }
 }
Ejemplo n.º 2
0
 public void SendMessage(string label, object body, string queueName, string errorLogPath)
 {
     if (_logger == null)
     {
         _logger = new QueueLogger("SendQueueMessages", errorLogPath);
     }
     try
     {
         _logger.AddMessage(String.Format("Send message on {0} with label {1}", queueName, label));
         CreateAndGetQueue(queueName).Send(body, label, MessageQueueTransactionType.Single);
         //Trace.WriteLine("Sent message: " + label);
     }
     catch (Exception ex)
     {
         _logger.AddMessage(String.Format("Error sending message on {0} with label {1}: {2}", queueName, label, ex.Message));
     }
 }