static void Process() { var ts = new TimeSpan(0, 0, 10); qc = new QueueConfig(ConfigurationSettings.AppSettings); q = new ReqMessageQueue(qc.queueName); qOut = new ReqMessageQueue(qc.queueOut); while (true) { try { Message msg = q.Receive(ts); HandleMessage(msg); } catch (MessageQueueException e) { // Test to see if this was just a timeout. // If it was, just continue, there were no msgs waiting // If it wasn't, something horrible may have happened } Console.Out.WriteLine("error " + e.Message); } } }