nservicebus subscriber implementation
Is having the event handler in the subscriber required? For example:
Projec开发者_StackOverflowts:
Crm.Events: NewUserCreated : IMessage {}
Crm.Publisher: console app publishes as Bus.Publish(new NewUserCreated());
Crm.Subscriber: console app subscribing to the NewUserCreated event.
Crm.EventHandlers NewUserCreatedHandler : IHandleMessages { ... }
Do I need the NewUserCreatedHandler in Crm.Subscriber or can I just reference the Crm.EventHandlers assembly in Crm.Subscriber so NSB can invoke the handler?
Thanks
You can just reference the eventhandler assembly. This is because NSB scan all assemblies in your bin directory for classed that implements IHandleMessages.
That said, can you explain why would you want to separate the messagehandlers from your "Crm.Subscriber" project?
精彩评论