This project is read-only.

Configuring IOC Container

Jul 7, 2010 at 6:54 PM

Are there any examples on how to adapt another IOC container for SSB to use instead of StructureMap?

Jul 7, 2010 at 7:08 PM

Please disregard the question. After digging into the source, I see how it's done now. For those just starting with SSB like myself, I hope to save them some time...

If you wish to force SSB to use your existing IoC container instead of the out-of-the-box object builder (NOT StructureMap as I mistakenly thought), all you have to do is create a project to adapt the IObjectBuilder interface to your IoC container. Look at the SimpleServiceBus.StructureMap project for an example. Then, when creating and configuring your endpoints, simply register your implementation of IObjectBuilder with the EndpointBuilder.

For our project, we're using Unity. I'm in the process of writing an adapter now and will approach the SSB team about possibly including the project in their source.

@SSB Team: Is that accurate? Is there anything you would add?


Jul 8, 2010 at 12:19 AM

Yes, that's right. We went through quite a bit of work to get it working with Windsor Castle, had to figure out what should be singleton, etc. But it can be done. The code we created is part of our main product, but if anyone wants to see how it's done I think I can share the part where we wire up Windsor.