将数据库与 NServiceBus 结合使用
在阅读 NServiceBus 的 入门 文档时,我发现它可以(并且应该)使用数据库扩展到多台计算机时获取订阅信息。
但它没有说如何。我查看了其他文档,我不知道如何执行此操作(尽管我承认我还没有全部阅读)。
谁能指出我在哪里可以找到此信息?或者告诉我该怎么做?
In reading the Getting Started doc for NServiceBus I see that it can (and should) use a Database for subscription information when scaling out to more than one machine.
But it does not say how. I have looked at the other docs I don't see how to do this (though I admit I have not read them all yet).
Can anyone point me to where I can find this info? Or tell me how to do it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您需要配置 DBSubscriptionStorage 而不是 MsmqSubscriptionStorage。
这可以通过多种方式完成:
如果您对其中任何一个有详细问题,请发表评论或编辑您的问题。
You need to configure the DBSubscriptionStorage instead of the MsmqSubscriptionStorage.
this can done in multiple ways:
if you have detailed questions about any of these please comment or edit your question.
如果您正在使用 NServiceBus.Host(并且您很可能是),则 NServiceBus 配置文件实际上会覆盖“Configure.With()”内容。例如,当您启动主机时,它会自动配置为使用 NServiceBus.Lite 配置文件运行。这意味着它将使用内存订阅存储而不是数据库订阅存储——即使您指定了 DBSubscriptionStorage()。诀窍是使用 NServiceBus.Production 命令行参数运行主机。
此外,您的 IConfigureThisEndpoint 实现还必须实现“AsA_Publisher”。
换句话说,如果您希望 NServiceBus 与您的数据库订阅存储对话,它必须运行 NServiceBus.Production 配置文件(或您自己的自定义配置文件)并配置 AsA_Publisher。
If you're using NServiceBus.Host (and you most likely are), the NServiceBus profiles actually override the "Configure.With()" stuff. For example, when you fire up the host it is automatically configured to run with the NServiceBus.Lite profile. This means that it will be using an in-memory subscription storage instead of your database subscription storage--even if you specify DBSubscriptionStorage(). The trick is to run the host using the NServiceBus.Production command-line parameter.
Furthermore, there's one your IConfigureThisEndpoint implementation must also implement "AsA_Publisher".
In other words, if you want NServiceBus to talk to your database subscription storage, it must running the NServiceBus.Production profile (or your own custom one) as well as be configured AsA_Publisher.