IoC, Containers, and NServiceBus confusion
- by andy
Hey guys, here's my setup
Castle Windsor is my container
NServiceBus is itself using it's own container internally, Spring by default
I'm implementing the PubSub config.
Ok, if I have my Bus.Publish happening within my IWantToRunAtStartup class, then everything is fine. As a test for example on Run() we can start a timer and it'll go into a Service style loop.
However, what if I want to abstract NServiceBus from my app, and have my app go:
new CustomPulisherClass().Notify(ISomeMessage msg);
In this situation, how do I implement CustomPublisherClass.
My confusion is coming from the fact that NServiceBus is already running as a Service, it's already been "Started". How to I get at the correct instance of the Bus object?
cheers
andy