Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/visual-studio/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 正在发送肯定确认消息时,未发送MSMQ否定确认消息_C#_Visual Studio_Msmq - Fatal编程技术网

C# 正在发送肯定确认消息时,未发送MSMQ否定确认消息

C# 正在发送肯定确认消息时,未发送MSMQ否定确认消息,c#,visual-studio,msmq,C#,Visual Studio,Msmq,您好,我有一段代码,当消息到达其预期队列时,它可以很好地工作(消息在队列中结束,确认消息在另一个队列中结束,指示消息已到达目的地) 由于某些原因,当消息未到达其队列(确认消息从未发送到其队列)时,它无法按预期工作 我一直在通过简单地删除常规消息要到达的私有队列(如果有帮助的话)来测试这一点 Message message = new Message(); message.TimeToReachQueue = TimeSpan.FromMilliseconds(m_timeToReachQueue

您好,我有一段代码,当消息到达其预期队列时,它可以很好地工作(消息在队列中结束,确认消息在另一个队列中结束,指示消息已到达目的地)

由于某些原因,当消息未到达其队列(确认消息从未发送到其队列)时,它无法按预期工作

我一直在通过简单地删除常规消息要到达的私有队列(如果有帮助的话)来测试这一点

Message message = new Message();
message.TimeToReachQueue = TimeSpan.FromMilliseconds(m_timeToReachQueue);
message.AcknowledgeType =  AcknowledgeTypes.FullReachQueue;
// set admin queue for receiving (negative) acknowledgements of delivery                
message.AdministrationQueue = new MessageQueue(m_adminQueueName);
message.ResponseQueue = new MessageQueue(m_adminQueueName);

//This is just for populating the message body and label then finally sending it
message.Label = RenderLabel(loggingEvent);       
using (System.IO.MemoryStream stream = new System.IO.MemoryStream())
    {
        System.IO.StreamWriter writer = new System.IO.StreamWriter(stream, new System.Text.UTF8Encoding(false, true));
        base.RenderLoggingEvent(writer, loggingEvent);
        writer.Flush();
        stream.Position = 0;
        message.BodyStream = stream;

        m_queue.Send(message);
        m_queue.Close();
    }

如果添加UseDeadLetterQueue,是否会在DLQ中看到消息?“追踪你的MSMQ信息的去向”我也面临同样的问题,还没有找到解决方案。根据-“将向管理队列返回否定确认(NACK),其类为“目标队列不存在”。(MQMSG_class_NACK_BAD_DST_Q)”。但在现实中,这似乎并没有发生。