Spring

Project Hosting
NuGet NServiceBus.Spring (4.x)
Target NServiceBus Version: 4.x
Standard support for version 4.x of NServiceBus has expired. For more information see our Support Policy.

NServiceBus can be configured to use Spring as a dependency injection container.

Default Usage

configure.SpringFrameworkBuilder();

Existing Container Instance

var applicationContext = new GenericApplicationContext();
applicationContext.ObjectFactory
    .RegisterSingleton("MyService", new MyService());
configure.SpringFrameworkBuilder(applicationContext);

DependencyLifecycle Mapping

The way that the NServiceBus.Spring adapter is implemented means that the dependency lifecycle's of NServiceBus do not map directly to Spring Object Scopes. Almost all of the lifecycles have been implemented using a custom type regsitrations on top of a Generic Application Context.


Last modified