Ongoing Notes

NServiceBus

All entries here should be taken with a big pinch of salt. There are my notes whilst playing around with NServiceBus.  If you see something is wrong then feel free to let me know.

Configuring your DLL project to run as a host

One not-so obvious gotcha is that to use the NServiceBus.Host.Exe your DLL must reference NServiceBus.Host.Exe. Ok maybe that is obvious, but when you go to the project properties to change the startup option to that exe it isn’t in your bin folder. You must build the project before it copies the EXE into the folder. So Build once then change the startup option.

Pub/Sub

The first thing that has caught me out is that I assumed that when you Bus.Publish a message it will go into a queue for subscribers to read the messages from. This looks like an incorrect assumption. If you publish a message and no-one has subscribed then the message is “lost”.

More later

More later

Advertisements

3 Responses to Ongoing Notes

  1. Jonathan Oliver says:

    A little trick to avoid copying the NServiceBus.Host.exe to your bin manually (or having to compile) before changing your project properties is to modify your project file and add the following:

    Program
    $(ProjectDir)$(OutputPath)NServiceBus.Host.exe
    NServiceBus.Production

  2. Jonathan Oliver says:

    It looks like it stripped out the HTML tags of my previous comment.

  3. Jonathan Oliver says:

    Try adding this to your project file:

    <PropertyGroup>
    <StartAction>Program</StartAction>
    <StartProgram>$(ProjectDir)$(OutputPath)NServiceBus.Host.exe</StartProgram>
    <StartArguments>NServiceBus.Production</StartArguments>
    </PropertyGroup>

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s