Solutions    |    Downloads    |    License    |    Documentation    |    Training    |    Support    |    Customers    |    About Us

NServiceBus Installers

Last Updated: Jan 23, 2013 08:39AM IST

In 3.0 we introduced the concept of installers to make sure that both infrastructure and endpoint specific artifact installed and configured automatically for you if needed.

The installers comes in two flavors, infrastructure installers and regular installers.
Infrastructure installers are used for things that are not specific to a given endpoint e.g. RavenDB, MSMQ.
Regular installers are focused on setting up things that the current endpoint is depending on e.g.. queues, folders, databases etc.

Infrastructure installers are always invoked before regular installers. Although the installers are mainly used internally you could use the for your own purposed as well. Perhaps you need to make sure folders are created, database scripts invoked etc etc.

To create your own installer is as easy as implementing the INeedToInstallInfrastructure<T> interface.
The generic parameter gives you a way to restrict your installer to a specific platform.
Currently this is either Windows or Azure.
If you don’t care about the environment use the INeedToInstallInfrastructure interface instead. To create a regular installer you just implement the INeedToInstallSomething<T> interface again using the T to restrict it to a specific environment.

NServiceBus will scan the assemblies in the runtime directory for installers so you don’t need any code to register them.


When are they invoked?

When using the NServiceBus host installers are invoked as follows:

  Installers Invoked
Command Line Parameters Infrastructure Regular
/install NServiceBus.Production
NServiceBus.Production × ×
/install NServiceBus.Integration
NServiceBus.Integration ×
/install NServiceBus.Lite
NServiceBus.Lite ×

As you can see the installers are controlled by both the /install command line option to the host and the current profile used. You can of course implement your own profile if you have other requirements.

When self hosting NServiceBus you have to invoke the installers manually using:


Configure.Instance.ForInstallationOn<NServiceBus.Installation.Environments.Windows>().Install()

A full example can be found here.

Finally there is one final way to run the infrastructure installers. If you invoke the host with the /installInfrastructure flag the host will run only the infrastructure installers for you without requiring you to configure anything. This can be useful when you setup a new server or a developer machine since that verifies and installs the required infrastructure for NServiceBus to run. The RunMeFirst.bat included in the download is doing just that.

About NServiceBus    |    Contact Us    |    Privacy    |    Follow us on:   
Copyright 2010-2013 NServiceBus. All rights reserved
support@nservicebus.com
http://assets3.desk.com/raca8b478c9bd89640c451013350d59caa6b66ee1/javascripts/
nservicebus
Loading
seconds ago
a minute ago
minutes ago
an hour ago
hours ago
a day ago
days ago
about
true
Invalid characters found
/customer/en/portal/articles/autocomplete
There was an error contacting Get Satisfaction
View All
0
discussions
replies
Questions
Ideas
Problems
Praise