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