asp.net mvc 4 - How do I get my MVC application to send commands and subscribe to events in NServiceBus -
perhaps i'm missing here , question maybe same this one sorry duplication.
i have mvc4 site quite happily sends() commands nservicebus server. want same mvc site able subscribe ievents publish()ed same nservicebus server. can't work.
messages being published server , showing in msmq can't mvc site pick them up.
is possible nservicebus 3.3.5? , if so, how have set mvc site make work?
thanks in advance!
edit: here's config have in mvc app:
configure.with() .log4net() .structuremapbuilder() .msmqtransport() .istransactional(false) .purgeonstartup(false) .unicastbus() .loadmessagehandlers() .impersonatesender(false) .jsonserializer() .createbus() .start(() => configure.instance.forinstallationon<nservicebus.installation.environments.windows>().install());
i don't have endpointconfig class implements iconfigurethisendpoint or , asa_ interfaces. i've tried adding 1 never gets called , can't work out host or how start nservicebus host application web app. or context host run under if code sits inside iis (if makes sense!).
my guess you're missing .loadmessagehandlers()
line in fluent config after .unicastbus()
- that's common error leads self-hosted applications not processing messages sent them.
if that's not case, add fluent config block question , we'll take look.
edit: after fluent config posted
my next guess you're declaring serializer late. .unicastbus()
step 1 of last stops before "let's start thing!" i'm thinking perhaps time you've hit point, config has made assumption you're going default xmlserializer. try moving serializer line right after .structuremapbuilder()
, see if works better?
if doesn't work might consider using .defaultbuilder()
momentarily rule out problem ioc container.
in regards other comments, self-hosted bus never have endpointconfig. that's pointer endpoints hosted nservicebus.host.exe only.
i suppose it's not obvious you're calling fluent config from. code needs called once when webapp started - application start method in global.asax. because webapp in control, there's no automatic assembly scanning find , wire nservicebus pipeline in nservicebus host.
Comments
Post a Comment