I am getting an error "Message requested was not found in the queue specified" when using transactions in remote MSMQ. If transaction is removed or if the queue is moved to same machine, everything works just fine. The queue is on Windows 2008 machine and the client (code shown below) is run on Windows 7 machine.
//Throws above error
using (MessageQueueTransaction mqTxn = new MessageQueueTransaction())
{
mqTxn.Begin();
Message message = messageQueue.ReceiveById(peekedMessage.Id, mqTxn);
mqTxn.Abort();
}
//Throws above error
using (TransactionScope txnScope = new TransactionScope())
{
Message message = messageQueue.ReceiveById(peekedMessage.Id, MessageQueueTransactionType.Automatic);
}
//Works fine
Message message = messageQueue.ReceiveById(peekedMessage.Id);
P.S. peekedMessage is messages peeked just before these calls. I have verified that the peekedMessage.Id matches with the first queue item. The queue is transactional.