开发者

Using a database with 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.

B开发者_运维问答ut 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?


You need to configure the DBSubscriptionStorage instead of the MsmqSubscriptionStorage. this can done in multiple ways:

  • define the production profile http://www.dualbotic.com/DasBlog/Understanding+NServiceBus+Subscription+Storage+And+Profiles.aspx
  • define the DBSubscriptionStorage in your app.config http://docs.particular.net/nservicebus/messaging/publish-subscribe/ (under SubscriptionStorage)
  • or define it via code in NServiceBus.Configure.With().DbSubscriptionStorage.

if you have detailed questions about any of these please comment or edit your question.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜