from (string args) - Modified for readability As this method need to returns something that implements IServiceLocator, using the DefaultMassTransitContainer type makes life a little easier as it does a fair bit of the plumbing for you including setting the current service locator to itself. Again the authors have decided to use Castle Windsor for the sample, however I believe you can use any of the CommonServiceLocator Containers. In here we can define some delegate for certain event in service life (WhenStarted, WhenStopped etc) and we can also weave some of our IoC voodoo majic by defining our service locator. Next we need to configure the service(s) we are hosting. This is great for demos, but I am not sure if it is intended for production use… Chris and Dru may care to comment on this either way its handy when getting to terms with the stack. We can also use the UseWinFormHost where we can supply the name of the WinForm that is the host. Instructing how the service will be run: Define any known dependencies (MSMQ, IIS, SqlServer etc), any actions that should be performed prior to running the service/host and also how the service is to be run: i.e what credentials will the service run under. The display name and description are visible from the Service Control Manager while the service name is intend for console line interactions Once you have done this, the TopShelf Runner can host the service.ĭescribing the Service means give the service a name, a display name and a description. The basic set up steps for creating a runner configuration are: you will see TopShelf being used to set up our MassTransit programs in the entry points of our application, typically with the Program.Main(string args) method. MassTransit has split the host service into a separate project, namely TopShelf. We need configure the service to know what to start up, how to find it and in what context to run it. The glue that ties all of MassTransit’s moving pieces has to be done on starting you application.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |