Book Image

Learning NServiceBus - Second Edition

By : David Boike
Book Image

Learning NServiceBus - Second Edition

By: David Boike

Overview of this book

Table of Contents (18 chapters)
Learning NServiceBus Second Edition
Credits
Foreword
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Hosting types


Hosting NServiceBus comes down to configuring and then starting an instance of a bus. There are two ways to do this, either as an NServiceBus-hosted endpoint, or as a self-hosted endpoint. In both cases, the focus is on setting up your desired settings via a BusConfiguration object.

NServiceBus-hosted endpoints

An NServiceBus-hosted endpoint is a process that is run by executing the NServiceBus.Host.exe process, which is a part of the NServiceBus.Host NuGet package. We already know that a .NET executable is just a DLL that can be directly executed, and can be referenced just like a normal DLL. The host's NuGet package automates the process of creating a reference to the executable, and then sets the Debug tab's Start Action to run the host executable. You can see this for yourself by opening a hosted endpoint's properties page and inspecting the settings on the Debug tab.

When the host process starts up, it scans all the assemblies in the same directory, looking for a class that...