NServiceBus.Hosting Futures


(Matt Ritchie) #1

I’ve noticed in https://docs.particular.net/nservicebus/upgrades/host-7to8 that NSB.Host is being deprecated.

I’m currently planning an upgrade from NSB4.7/.Net4/mvc4/ef6 to NSB6.3/net452/aspnetcore/efcore.

Attemping to do so with netcore sdk libraries and aspnetcore but targeting net452. To ensure that my upgrades to netstandard post NSB6 will work easier. Surprisingly it’s going well.

I’ve had to drastically change all my endpointconfigs and ensure that everything is running. I’m now considering standardising even further to netcore configuration, logging and dependency injection libraries.

My Question
Now that I’ve noticed that NSB.Host is on the way out, can I use selfhost for all services under NSB6.3 and install as windows services? Is there any downsides to this over the current topshelf host?

Is topshelf now gone from NSB Ecosystem?

This will mean that all my webapps, nsb services, console apps all have a program.cs and a similar NSB startup process. But also i can standardise my configuration in all projects into the appsettings.json format. I’m considering implementing a custom instance-mapping.xml into appSettings.json.

Using the conventions in Startup.cs to invoke :
public Startup(IHostingEnvironment env, ILoggerFactory loggerFactory) public IServiceProvider ConfigureServices(IServiceCollection services)would allow a nice experience to onboard my team into the netcore world and I’m already this far in with so many breaking changes?

Does anybody currently use selfhost exclusively? I have current console apps and webapps that self host, but i’ve never used selfhost and windows services together.

Cheers,
Matt


(Simon Cropp) #2

Hey Matt

I will try and quickly cover off you questions, and let me know if anything needs clarification.

Now that I’ve noticed that NSB.Host is on the way out, can I use selfhost for all services under NSB6.3 and install as windows services

Yep https://docs.particular.net/nservicebus/hosting/windows-service

and install as windows services

yep https://docs.particular.net/nservicebus/hosting/windows-service#installation

would allow a nice experience to onboard my team into the netcore

There are some complexities regarding netcore and windows services.

Is topshelf now gone from NSB Ecosystem?

Yes. although it is mostly obscured from users, the NSB host does use topshelf internally. So the NSB host will be supported for some time to come. But yes eventually no part of NSB will rely on topshelf

This will mean that all my webapps, nsb services, console apps all have a program.cs and a similar NSB startup process

Yes. this is the approach i have used in the past and observed at many other organisations.

Does anybody currently use selfhost exclusively?

Yes, I know of several, including places i have previously worked.

can I use selfhost for all services under NSB6.3 and install as windows services? Is there any downsides to this over the current topshelf host?

yes you still can. topshelf or not is usually matter of personal preference or organisational mandate. My preference is to have as fewer layers as possible between starting a process and getting to my initialisation code. it makes debugging common startup problems so much easier. There is a Comparison of self-hosted windows service to the NServiceBus Host, and those points can be broadly applied to “self-hosted windows service versus topshelf hosted”