Saturday, February 9, 2013

Beginning NServiceBus

I my day to day work we are using NServiceBus as our Enterprise Service Bus (ESB) implementation in an effort to advance our organization to a form of service oriented architecture (SOA). I am a newbie to SOA and NServiceBus, thus the journey has not always been smooth. I plan on posting short articles about very specific issues that I have encountered with using NServiceBus. This is the first such article.

I like many developers have to interface to legacy systems. These systems are usually connected via a .NET assembly and DllImport. NServiceBus comes with a program called NServiceBus.Host.exe that allows you to host your own service endpoints (basically a message handler). NServiceBus.Host.exe is provided to make your life easier (and it does).

When using NServiceBus.Host.exe to host your own services, upon loading it will scan the directory for all DLLs, load them and look for implementations of IConfigureThisEndpoint. In certain cases, this may cause NServiceBus.Host.exe to exit with an exception.

NServiceBus.Host.exe will still scan DLLs for other interface implementations during configuration (like IWantCustomInitialization), even with the NServiceBus.Host.execonfig file in place. So you will still have to exclude specific DLLs from the configuration scanning process. Here is an example, the Init() method of an IWantCustomInitialization handler:

Followers

About Me

I am married and have 4 wonderful children. I have a
Masters Degree in Applied Mathematics and Computer Science from Indiana University, and a Bachelor of Science in Electrical Engineering Technology from Purdue University