Hi,

I am hoping that someone knows the correct way to process/read Microsoft Message Queues.

I have an application the receives messages from a messaging server and places them on the Message queue after parsing them. This is done separatley for speed.

A separate application should read messages from the queue and place the information extracted from the Message into a database table.

How do I create an application that will continuosly process messages from the queue or waits until there is a new message?

A colleague has used a timer that uses a 500 millisecond period, which calls a processMessage function.

My thoughts are to create a recursive function that first uses the Peek() method. If a message is found it is processed (added to the database) and then "Received" (taken from the queue), then calls itself again. Or it waits indefinitely for a message to be processed.?

What do you thing?