Problem reading MSMQ - TechRepublic
General discussion
February 9, 2012 at 01:16 PM
colwa02

Problem reading MSMQ

by colwa02 . Updated 14 years, 4 months ago

What would the code look like to read this queue, one at a time and not remove the message when the read completes?

Here is a partial listing of the C# windows console application code snipets of the message put code:
MessageQueue que = new MessageQueue(“.\\private$\\inbound”);
que.Formatter = new BinaryMessageFormatter();
myMessage msg = new myMessage();
/* load the msg object here, many lines */
Object obj = msg;
Message mput = new Message();
mput.Label = “myAutomation”;
mput.Priority = MessagePriority.High;
mput.UseDeadLetterQueue = true;
mput.Body = obj;
mput.Formatter = new BinaryMessageFormatter();
try
{
que.Send(mput);
}

Every time i attempt a read, i can’t see the actual data.

This discussion is locked

All Comments