Spring

Source
NuGet Package 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 for dependency injection.

Default usage

configure.SpringFrameworkBuilder();

Using an existing context

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

DependencyLifecycle Mapping

The NServiceBus dependency lifecycle modes do not map directly to Spring object scopes. Almost all of the lifecycle modes have been implemented using custom type registrations using a Spring GenericApplicationContext.

Samples


Last modified