Nservicebus 为什么我的NService总线可以发送命令但不能发布事件?

Nservicebus 为什么我的NService总线可以发送命令但不能发布事件?,nservicebus,Nservicebus,我有一个web应用程序使用NService总线发送消息,另一个应用程序使用消息。web应用程序可以成功地向总线发送命令,并且消费者可以很好地处理命令。但web应用程序无法向总线发布任何事件。调用Bus.Publish(new TestEvent())时,队列中没有消息。在发布服务器的localhost:8080数据库中,也没有订阅记录。可能出了什么问题? 这是我的巴士初始: Configure.With() .DefineEndpointName("LtssService

我有一个web应用程序使用NService总线发送消息,另一个应用程序使用消息。web应用程序可以成功地向总线发送命令,并且消费者可以很好地处理命令。但web应用程序无法向总线发布任何事件。调用Bus.Publish(new TestEvent())时,队列中没有消息。在发布服务器的localhost:8080数据库中,也没有订阅记录。可能出了什么问题? 这是我的巴士初始:

Configure.With()
            .DefineEndpointName("LtssServiceHostNew")
            .StructureMapBuilder(container)
            .RavenSubscriptionStorage()
            .DefiningCommandsAs(t => t.Namespace != null && t.Namespace.StartsWith("eltss.Message") && t.Namespace.EndsWith("Commands"))
            .DefiningEventsAs(t => t.Namespace != null && t.Namespace.StartsWith("eltss.Message") && t.Namespace.EndsWith("Events"))
            .UseTransport<Msmq>()
            .PurgeOnStartup(true)
            .UnicastBus()
            .ImpersonateSender(false)
            .CreateBus()
            .Start(() => Configure.Instance.ForInstallationOn<Windows>().Install());
Configure.With()
.DefineEndpointName(“LtssServiceHostNew”)
.StructureMapBuilder(容器)
.RavenSubscriptionStorage()文件
.DefiningCommandsAs(t=>t.Namespace!=null&&t.Namespace.StartsWith(“eltss.Message”)&&t.Namespace.EndsWith(“命令”))
.DefiningEventsAs(t=>t.Namespace!=null&&t.Namespace.StartsWith(“eltss.Message”)&&t.Namespace.EndsWith(“事件”))
.UseTransport()
.PurgeOnStartup(正确)
.UnicastBus()
.ImpersonateSender(错误)
.CreateBus()
.Start(()=>Configure.Instance.ForInstallationOn().Install());

这看起来会引发一场对话,帮助您排除故障。我建议您将问题转移到该用户请求帮助解决其特定问题的论坛。需要进行对话才能得出问题所在。任何一个问题都不可能对查看此答案的其他用户有帮助。您需要配置订阅存储。NServiceBus is 2.0.3中的RavenDb版本在我们的项目中似乎与RavenDb版本2.5.7存在问题。它无法将订阅写入订阅存储。如果在没有RavenDB的情况下运行普通项目,则写入订阅存储不会有问题。有人有同样的问题吗?原来N服务总线不能与RavenDB 2.5一起工作。我必须修改NServiceBus以使用RavenDB 2.5。其他人也有同样的问题。