Category Archives: StructureMap

Support for child containers in NServiceBus

The NServiceBus trunk now has support for child|nested containers, thanks to Jonathan Oliver for supplying the patch. Be aware that child containers are not supported by so if you plan to take advantage of this you’d have to use one of the other containers supported by NServiceBus. Child containers is essentially a snapshot of [...]

Also posted in NHibernate, NServiceBus | Comments closed

Thread static caching in NServiceBus

NServiceBus keeps a static pool of threads that process incoming messages. This means that threads are not recreated for each new message with the effect that thread static variables are not cleared. If you use the thread static cache lifecycle of [Name of your favorite container here] this will have the effect that the objects [...]

Also posted in NServiceBus | Comments closed

NHibernate session management in NServiceBus

Edit: If you’re on the trunk version of NServiceBus there is a better way to manage the session using the child container feature. This post explains how to manage the NHibernate session when using NServiceBus. In NServiceBus each message becomes a unit of work so the recommendation is to use a new session for each [...]

Also posted in NHibernate, NServiceBus | Comments closed

Building lifecycle aware applications

Designing applications that can easily be reconfigured for the different stages in the development lifecycle is important when it comes to shorten the time between development and production. To achieve this we need ways to easily change our applications behavior as it moves through the various stages of software development. Having frameworks that help in [...]

Also posted in NServiceBus | Comments closed

>NServiceBus support for StructureMap

> I’ve just committed support for StructureMap to the NServiceBus trunk so if you are using NSB and prefer StructureMap as your IoC-Container you can get the latest NSB build from (thanks Udi for trusting me as a committer) To configure NSB to use StructureMap use the following syntax: var bus = Configure.With() .StructureMapBuilder() [...]

Also posted in NServiceBus | Comments closed

>UnitOfWork in WCF using StructureMap

> In this post I will demonstrate a way to automatically manage a UnitOfWork (UoW) for Windows Communication Foundation (WCF) service requests. This is the equivalent of “Session per request” that is popular for Web applications. The reason for all this is to move transaction management out of user code resulting in cleaner and more [...]

Also posted in WCF | Comments closed