Install NServiceBus as a Service with Powershell
Join the DZone community and get the full member experience.
Join For FreeI have just completed a script that can be used to install a service bus host as a windows service. It is nice to use, when delegating the installs to the support team, this is always done via NServiceBus.Host.exe.
It can always be tricky parsing arguments in PowerShell. The trick is to use the Start-Process command, and isolate the arguments into it’s own variable.
Here is the two scripts.
The one will install the license and the other installs your endpoints as a windows service. All you now need to do, is just type in the password.
It relies on a directory structure, where.
Root\powershellscripts.ps1 Root\ServiceNameA\Debug or Root\ServiceNameA\Release Root\ServiceNameB\Debug or Root\ServiceNameB\Release
I hope this makes installing all your endpoints easy.
Now, remember, if you install Subscriber endpoints before publishers, you will get a race condition, so with this script, add the endpoints in the array argument in the correct dependent order. First install all the publisher endpoints first, then the subscriber endpoints.
Published at DZone with permission of Romiko Derbynew, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.
Trending
-
How to Submit a Post to DZone
-
How to LINQ Between Java and SQL With JPAStreamer
-
Avoiding Pitfalls With Java Optional: Common Mistakes and How To Fix Them [Video]
-
Extending Java APIs: Add Missing Features Without the Hassle
Comments