tags:

views:

188

answers:

1

I have the following scrap of code to test MSMQ acknowledgments:

 static void Main(string[] args)
 {
  string queuePath = args[0];
  string ackQueuePath = args[1];
  MessageQueue queue = new MessageQueue(queuePath);
  MessageQueue ackQueue = new MessageQueue(ackQueuePath);
  Message message = new Message("Body text");
  message.Label = "test";
  message.Recoverable = true;
  message.TimeToReachQueue = new TimeSpan(0, 1, 0);
  message.TimeToBeReceived = new TimeSpan(1, 0, 0);
  message.AdministrationQueue = ackQueue;
  message.AcknowledgeType = AcknowledgeTypes.FullReachQueue;
  queue.Send(message, MessageQueueTransactionType.Single);
 }

If both queuePath and ackQueuePath are local, i.e. ".\private$\queuename" format, I get the "test" message in the main queue and a reach-queue acknowledgement in the admin queue as expected. However, if queuePath points to a remote queue, i.e. "FormatName:DIRECT=OS:MACHINENAME\private$\queuename" format, I get the "test" message in that remote queue, but no reach-queue acknowledgment in the local admin queue.

I haven't seen anything indicating that acknowledgments cannot be returned from remote queues, so I presume there is a problem with my code or my environment. Any ideas?

(Both machines are Windows 2003.)

A: 

For reference, this worked properly after I reinstalled message queueing on both machines.

marijne
That really sucks... says a lot about msmq. I started using it some weeks ago and I still have thousands of questions why sometimes this or that doesn't work...
Lieven Cardoen