I’ve setup a NSB Gateway demo project which all works fine. (SiteA sends msg to SiteB, and SiteB reply a confirmation. ie.Bus.Reply())
Then I went ahead using .CatleWindsorBuilder() instead of the .DefaultBuilder().
mostly working, got my custom types injected. however, exception thrown when Bus.Reply() at SiteB.
Bus.Reply<CustomerOrderReceived>(m => { m.BranchOffice = "US"; m.Description = message.Description; });
The exception is: “No handlers could be found for message type: CustomerOrderReceived”
It sounds like it couldn’t find the SiteA’s OrderReceivedMessageHandler : IHandleMessages<CustomerOrderReceived>
Here’s SiteA’s EndpointConfig
_container = new WindsorContainer();
Configure.With()
.CastleWindsorBuilder(_container)
.XmlSerializer()
.MsmqTransport().IsTransactional(true)
.FileShareDataBus(".\\databus").UnicastBus().ImpersonateSender(false).LoadMessageHandlers();
_container.Register(Component.For<IOrderTask>().ImplementedBy<OrderTask>());
_container.Register(Component.For<IWindsorContainer>().Instance(_container));
_container.Install(FromAssembly.InThisApplication());
however the message handlers within SiteA all works fine.
Wondering if someone have the working sample of Castle Windsor IOC in NSB? I just couldn’t find anything useful on google.
Got is sorted! by using StructureMapBuilder()
However, now I believe it’s the NSB bug when handling Bus.Reply() in Gateway scenario.