msmq 中没有消息
我编写一个控制台应用程序,将消息添加到本地队列。但是,没有插入任何消息。
我将队列创建为事务性队列并按如下方式插入:
string path = @"FormatName:DIRECT=OS:computername\private$\myqueue";
MessageQueue queue = new MessageQueue();
queue.Path = path;
foreach (string msg in messages)
{
queue.Send("inputMessage", msg);
}
这有什么问题吗?
谢谢。
I writing a console app that add a message to local queue. But, no message is being inserted.
I created the queue as transactional and inserting like following:
string path = @"FormatName:DIRECT=OS:computername\private$\myqueue";
MessageQueue queue = new MessageQueue();
queue.Path = path;
foreach (string msg in messages)
{
queue.Send("inputMessage", msg);
}
Anything wrong with this?
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
简单的一个,这个。
您正在向事务队列发送非事务性消息。 MSMQ 将丢弃该消息。
使用 "MessageQueue.Send(Object, MessageQueueTransaction) 方法
如果启用负源日记,您可以查看死信队列以了解消息被丢弃的原因。
干杯
约翰·布瑞克韦尔
Easy one, this.
You are sending a non-transactional message to a transactional queue. MSMQ will discard the message.
Use the "MessageQueue.Send(Object, MessageQueueTransaction)" Method
If you enable Negative Source Journaling, you can look in the dead letter queue to see why messages gets discarded.
Cheers
John Breakwell
您需要先创建队列,然后才能发送(这是一次性操作,除非您删除队列):
You need to create the queue before you can send to it (it's a one time operation, unless you delete the queue):
尝试交换发送的顺序。
我必须仔细检查,但我很确定顺序是对象,标签
try swapping the order on your send.
I'd have to double check but i'm pretty sure the order is object, label
如果您有事务队列,请务必检查您是否正在使用事务
请参阅另一篇文章中的更多信息 消息在进行事务处理时不会到达 MSMQ
if you have transactional queues, make sure to check that you are using transactions
see more info in another post Message does not reach MSMQ when made transactional