开发者

Message queue 'number of messages' is always 0

开发者 https://www.devze.com 2022-12-30 12:36 出处:网络
I am trying to send messages to MSMQ on Windows 7 using C#. The code is as below: using(var q = new MessageQueue(\".\\Private$\\hellomsmq\"))

I am trying to send messages to MSMQ on Windows 7 using C#. The code is as below:

using(var q = new MessageQueue(".\Private$\hellomsmq"))
{
    q.Send(new Message());
}

But when I refresh in Computer Management the 'number of messages' (Message Queuing/Private Queues/hellomsmq) stays at 0. I did not get any exceptions/err开发者_开发百科ors while performing send().

Can anyone help please. Thanks!


Is that queue transactional? If so. I believe you have to send your message as a transaction or use the two-parameter version of Send with MessageQueueTransactionType.Single as the second parameter.

0

精彩评论

暂无评论...
验证码 换一张
取 消