NServiceBus:没有为消息指定目的地:

时间:2013-01-28 09:59:04

标签: asp.net-mvc nservicebus

我刚创建了一个新的NServiceProject,如以下链接所示:

http://support.nservicebus.com/customer/portal/articles/856687-getting-started---creating-a-new-project

但是在运行项目后,我收到了以下错误

"No destination specified for message(s):".

我不确定我哪里出错了。

我创建了ASP.NET MVC类型的项目。

4 个答案:

答案 0 :(得分:2)

NServiceBus“没有为消息指定目的地:”通常是由于路由配置丢失或定义不正确造成的。

为了让NServiceBus为消息找到正确的目标队列,路由配置必须定义传递映射。可以为命令,类型或事件定义路由。

https://docs.particular.net/nservicebus/messaging/routing

以下代码段显示了NServiceBus 6的路由示例:

var transport = endpointConfiguration.UseTransport<SqlServerTransport>();
var routerConfig = transport.Routing();
routerConfig.RouteToEndpoint(
    assembly: typeof(MyMessage).Assembly,
    destination: "my.nservicebus.queue");

答案 1 :(得分:1)

您应该指定端点配置:

<UnicastBusConfig ForwardReceivedMessagesTo="audit">
<MessageEndpointMappings>
  <add Messages="InternalMessages.Commands.SendOrderConfirmationEmail, InternalMessages" Endpoint="ExternalGateway.Salesforce" />
</MessageEndpointMappings>

答案 2 :(得分:0)

我不确定你可能做了什么,但听起来你错过了某个地方的一步。我按照教程编写了一份工作副本供您参考,我希望它能帮助您确定问题。

https://github.com/sliedig/NServiceBusStudio.Amazon.Demo

答案 3 :(得分:0)

这是因为您错过了添加NServiceBus主机端点的步骤:

继续创建另一个名为OrderProcessing的端点作为NServiceBus主机。