当我们使用/install 标志将 NServiceBus 3.3.6 端点安装为 Windows 服务时,它会自动配置为具有对消息队列的 Windows 服务依赖性。
但是,即使我们的 NServiceBus 端点使用 RavenDb 进行持久化,安装程序也不会配置对 RavenDb 的服务依赖项。这意味着当我们的服务器重新启动时,我们的大多数 NServiceBus 端点由于以下异常而无法启动:
System.InvalidOperationException:
The database {name} is currently being loaded, but after 30 seconds,
this request has been aborted. Please try again later, database loading continues.
有什么方法可以告诉 NServiceBus 建立对 RavenDb 的依赖,或者这是我们必须手动配置的东西,也许使用 INeedToInstallSomething<T>
?
最佳答案
你可以传递一个依赖列表,例如:
NServiceBus.Host.exe /install /dependsOn:"MSMQ,RavenDB"
列表需要用逗号分隔。
在 v4 中,命令行参数有点不同:
NServiceBus.Host.exe -install -dependsOn=MSMQ -dependsOn=RavenDB
关于ravendb - 将 NServiceBus 安装为依赖 RavenDb 的 Windows 服务,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18068929/