【问题标题】:NServiceBus 6.4.3 configured to MSMQ fails on startup配置为 MSMQ 的 NServiceBus 6.4.3 在启动时失败
【发布时间】:2018-05-01 02:11:14
【问题描述】:

我正在尝试使用 NServiceBus 和 MSMQ 作为传输。一个很简单的例子:

static void Main(string[] args)
{
    var endpointConfiguration = new EndpointConfiguration("myappqueue");
    endpointConfiguration.UseTransport<MsmqTransport>();

    var endpointInstance = Endpoint.Start(endpointConfiguration).Result;
    Console.ReadKey();
    endpointInstance.Stop();
}

我已在其中添加了 Windows 功能消息队列并创建了一个名为 myappqueue 的私有队列。

当我运行应用程序并到达 Endpoint.Start 行时,我收到以下错误:

错误转发需要使用 'EndpointConfiguration.SendFailedMessagesTo()' 指定错误队列

我错过了什么?此配置未在 Particular 文档站点上的示例中提及。

【问题讨论】:

    标签: nservicebus msmq


    【解决方案1】:

    当端点创建并运行时,消息可能无法处理。在这种情况下,NServiceBus 需要将失败的消息转发到您需要指定的指定错误队列。 EndpointConfiguration.SendFailedMessagesTo() 是用于配置要使用的错误队列的 API。

    在配置端点以进行错误处理时,您会发现 this documentaiton 很有帮助。由于您是 NServiceBus 的新手,tutorials 也很有帮助。

    【讨论】:

    • 问题是,教程完全集中在LearningTransport上,这有点违背目的。无论如何,我在阅读MSMQ页面时显然完全是盲目的,因为现在我刚刚在开头的突出显示框中看到了这句话:使用MSMQ作为传输时,还必须指定错误队列配置。 傻我,谢谢你指出来。 :-)
    • @CarstenGehling 您的评论很重要(“教程完全集中在 LearningTransport,这与目的背道而驰。”)。您能否将其作为本教程的反馈提供?在right top corner 中有一个button 提供反馈。谢谢。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-04-02
    • 1970-01-01
    • 2011-05-20
    • 1970-01-01
    • 2018-04-04
    • 2010-12-28
    相关资源
    最近更新 更多