NServiceBus已安裝程序的概念,以確保端點特定具體的文物如。、隊列、文件夾或數據庫安裝和配置自動爲您若是須要在安裝時。shell
建立您本身的安裝程序同樣容易實現 INeedToInstallSomething<T>
接口。數據庫
public interface INeedToInstallSomething<T> : INeedToInstallSomething where T : IEnvironment { void Install(string identity); }
通用參數給你限制你的安裝程序到一個特定的平臺。目前這是或Windows Azure。ide
若是你不關心運行時環境,只是使用 INeedToInstallSomething
接口。this
public interface INeedToInstallSomething { void Install(string identity); }
NServiceBus掃描組件在運行時目錄安裝,這樣你就不須要任何代碼註冊它們。命令行
只有3.0版本:版本3.0提供了一個接口 INeedToInstallInfrastructure<T>
接口。它主要是用於事情並不特定於給定端點。,RavenDB或MSMQ。這個接口已經棄用在版本4.0和5.0將被刪除,由於的引入powershell commandlets援助基礎設施的安裝。code
當它們調用嗎?接口
使用NServiceBus主機時,調用安裝如圖所示:隊列
命令行參數
基礎設施(v3.0)安裝
常規安裝程序get
/安裝NServiceBus.Production
✔
✔string
NServiceBus.Production
✖
✖
/安裝NServiceBus.Integration
✔
✔
NServiceBus.Integration
✖
✔
/安裝NServiceBus.Lite
✔
✔
NServiceBus.Lite
✖
✔
安裝程序是由兩個控制 /install
命令行選項和主機使用的電流分佈。固然,您能夠實現您本身的配置文件,若是你有其餘需求。
當自我託管NServiceBus、手動調用安裝使用:
var configuration = new BusConfiguration(); configuration.EnableInstallers(); Bus.Create(configuration);//this will run the installers
的使用 /installInfrastructure
國旗的 NServiceBus.Host
已棄用4.0版。安裝所需的基礎設施,使用powershell commandlets來代替。