NServiceBus Version 5 Asp.NET MVC -
NServiceBus Version 5 Asp.NET MVC -
we have asp.net mvc 4 website using nservicebus send messages various services. because our dev environments don't have these services installed, stub servicebus instance local development. utilize autofac module registered in our application_start set , configure our bus instance injection controllers.
my nsb 3.3 configuration:
public class servicemodule : module { protected override void load(containerbuilder builder) { builder.register<ibus>((c, p) => { var useservicebus = bool.parse(configurationmanager.appsettings["useservicebus"]); if (useservicebus) { homecoming nservicebus.configure.with() .log4net() .defaultbuilder() .xmlserializer() .msmqtransport().istransactional(false).purgeonstartup(false) .msmqsubscriptionstorage() .unicastbus().impersonatesender(false) .createbus() .start(() => nservicebus.configure.instance.forinstallationon<nservicebus.installation.environments.windows>().install()); } else homecoming c.resolve<testservicebus>(); }).singleinstance(); } }
my attempted nsb 5.0.3 configuration:
public class servicemodule : module { protected override void load(containerbuilder builder) { builder.register<ibus>((c, p) => { var useservicebus = bool.parse(configurationmanager.appsettings["useservicebus"]); if (useservicebus) { var configuration = new busconfiguration(); configuration.usepersistence<ravendbpersistence>(); configuration.registercomponents(r => { r.configurecomponent<environmentmessagemutator>(() => new environmentmessagemutator(new detectsenvironment().getenvironment()), dependencylifecycle.instancepercall); }); homecoming bus.create(configuration); } else homecoming c.resolve<testservicebus>(); }).singleinstance(); } }
bus.create failing objectdisposedexception, "cannot access disposed object" on commonobjectbuilder. can't find documentation on right way set in nsb 5, or how configure regular nservicebus injection allow stubbing described above.
(this should tagged nservicebus 5, don't have reputation)
okay, turns out nsb 5's way of telling you have servicecontrol monitoring plugins installed in endpoint, don't have appropriate queues on machine.
solution install servicecontrol.
asp.net-mvc nservicebus
Comments
Post a Comment