Ejemplo n.º 1
0
        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);
                }
            }
        }
Ejemplo n.º 2
0
        public void LoadQueues(QueueConfig qc)
        {
            qConfiguration = qc;

             queueName = new ReqMessageQueue(qc.queueName);
             queueFileProcess = new ReqMessageQueue(qc.queueFileProcess);
             queuePrintBatch = new ReqMessageQueue(qc.queuePrintBatch);
             queueFileValidation = new ReqMessageQueue(qc.queueFileValidation);
             queueRequest = new ReqMessageQueue(qc.queueRequest);
             queueOut = new ReqMessageQueue(qc.queueOut);
        }
Ejemplo n.º 3
0
 public IList<Message> GetMessages(QueueType qType)
 {
     ReqMessageQueue q = new ReqMessageQueue(qConfiguration.GetQueueName(qType));
     return q.GetAllMessages().ToList<Message>();
 }