Reputation: 9733
I've got some legacy code which sends objects over an MSMQ messagequeue. It worked fine but now the code is moved to a WCF service. Now suddenly limits are reached and the queue.Send line throws the exception:
"Insufficient resources to perform operation".
I'm not using netMsmqBinding, just sending it through MessageQueue objects so I dont know how to increase the quotum of the objects size.
MessageQueue queue = new MessageQueue(queueName);
using (MessageQueueTransaction tx = queue.Transactional ? new MessageQueueTransaction() : null)
{
if (queue.Transactional)
{
tx.Begin();
}
Message msg = new Message();
msg.Body = delivery;
msg.Label = delivery.GetType().Name + " " + delivery.DeliveryId;
msg.Formatter = new XmlMessageFormatter(new Type[] { typeof(Delivery) });
msg.Recoverable = true;
queue.Send(msg, tx);
}
After implementing IErrorhandler on the service for logging exceptions I see this right before the resources:
12/10/2015 7:54:06 AM Uncaught exception of type System.TimeoutException was thrown. Message: 'The operation did not complete within the allotted timeout of 00:00:09.9970000. The time allotted to this operation may have been a portion of a longer timeout.'
I've put all the timeouts (open/close/receive/send) on the client and service to 45 minutes and still this error of 10 seconds timeout comes. Strange.
What can I do?
Upvotes: 1
Views: 360
Reputation: 9733
Found the cause of the problem, it was my own fault. I had removed [XmlIgnore] attribute from the two biggest members of Delivery. And since Delivery was serialized with XmlMessageFormatter for message queueing the object was simply too big for the queue.
Sorry to bother you....
Upvotes: 1
Reputation: 6604
The likely issue is that you are reaching the storage/memory limit of MSMQ (~2GB) due to 1 or more reasons.
You can quickly check the queue sizes by checking the properties of the folder: %windir%\system32\msmq\storage
.
Upvotes: 0