The sample is a very good demonstration of how acknowledgements work, but I would be very causious about copying it into production code.
ReceiveAcknowledgment calls PeekByCorrelationId to find the relevant message in the admin queue, then calls ReceiveByCorrelationId to remove the message from the queue, and calls PeekByCorrelationId again for the next ack, and so on.
What you should know is that both Receive- and Peek- by correlation Id traverse the queue sequentially to find the right message. So, if you have a queue with 10,000 acknowledgements you would read, you would read, on average, 20,000 messages (5,000 for the first peek, 5,000 for the receive, 10,000 for the last peek) for each, or 200,000,000 (two hundred million) message reads in total.
It would have been much more efficient to read the acknowledges one-by-one and match them with the original message, rather than the other way around.
Hope that helps,
Yoel Arnon
http://www.msmq.biz