Bloggin in the UK RSS 2.0
 Tuesday, April 20, 2010

Official NserviceBus Documentation

The NServiceBus Host
Profiles for the Generic Host

Our Deployment Details

Version: NServiceBus v2.0 RTM
OS: Windows 2003 Server
App Type: Windows Service
Host: NServiceBus.Host.exe
Subscription Storage: MSMQ

Our Goal

We have just created a new publisher service and it has taken a bit of time to understand exactly how to deploy it so that subscriptions were persisted after the service is restarted.

Out of the box NServiceBus has three options for storing subscription data, Memory, MSMQ or Database.

To use MSMQ you must either create your own custom profile that configures subscriptions to be stored in MSMQ or you must select Integration from  the default profiles.

Regardless of the choice you make you must specify the profile you wish to use when you install the windows service, here is how you do that:

Basic Integration Example:
NServiceBus.Host.exe /install NServiceBus.Integration

Advanced Production Example:
NServiceBus.Host.exe /install NServiceBus.Production /serviceName:MyService /displayName:MyDisplayName/description:MyDescription /username:DOMAIN\username /password:MyPassword

To check the service has been setup correctly you can go and look in the properties of the service and check the text at the end of the "Path to executable" field. The example in the screenshot below shows the service is configured to use the Lite profile.




We had one more gotcha our implementation was copy/pasted from one of 
our existing v1.9 services so we had to remove the .MsmqSubscriptionStorage()
option from our config. Now our endpoint config looks like this

public void Init()

{
            NServiceBus.Configure.With()
                        .DefaultBuilder()
                        .XmlSerializer()
                        .MsmqTransport()
                        .IsTransactional(true)
                        .PurgeOnStartup(false)
                        .UnicastBus()
                        .ImpersonateSender(false)
                        .CreateBus()
                        .Start();
}


The Default Profile's Subscription Storage



Note: - If you select Production profile you may need to enable some settings inside MSDTC (in Component Services) if your database is on another server.
         - If you are installing on to a machine that has UAC enabled you must run the install from a cmd prompt with elevated priviledges (Run As Administrator)


Tuesday, April 20, 2010 2:08:25 PM (GMT Standard Time, UTC+00:00)  #    Comments [0] -
nServiceBus
Archive
<September 2010>
SunMonTueWedThuFriSat
2930311234
567891011
12131415161718
19202122232425
262728293012
3456789
About the author/Disclaimer

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2010
Charlie Barker
Sign In
Statistics
Total Posts: 172
This Year: 14
This Month: 1
This Week: 0
Comments: 77
Themes
Pick a theme:
All Content © 2010, Charlie Barker
DasBlog theme 'Business' created by Christoph De Baene (delarou)