charlessolar / Aggregates.NET

.NET event sourced domain driven design model via NServiceBus and GetEventStore

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Exceptions while still starting up

charlessolar opened this issue · comments

Instances start 2 message handling systems, one for events from eventstore, one for commands from nservicebus.
Some instances are initially throwing: "StructureMap.StructureMapConfigurationException: No default Instance is registered and cannot be automatically determined for type 'NServiceBus.IMessageSession'" for a few seconds upon startup because the event listener got up before nservicebus finished setting up.

Need to add a check in event subscriber to not send events until NSB is ready

Fixed this by not holding up bus initialization and changing the bus instance NSBOobHandler uses to publish