예제 #1
0
        public void SendMessage(string label, object body)
        {
            if (_logger == null)
            {
                _logger = new QueueLogger("SendQueueMessages");
            }

            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));
            }
        }
예제 #2
0
 protected void Log(string message)
 {
     if (_loggerEnabled)
     {
         if (_logger == null)
         {
             _logger = new QueueLogger("noesis-queue-recevier");
         }
         _logger.AddMessage(message);
     }
 }