Vaccano
Vaccano

Reputation: 82507

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.

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?

Upvotes: 1

Views: 1283

Answers (2)

Stephan Schinkel
Stephan Schinkel

Reputation: 5540

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.

Upvotes: 2

Jonathan Oliver
Jonathan Oliver

Reputation: 5267

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.

Upvotes: 1

Related Questions