tags:

views:

54

answers:

0

I'm have some mysterious problems with handlers being called more than once per event which appears to be correlated with events built up via interface inheritance.

We are using only interfaces for our messages and usingNServiceBus.MessageInterfaces.MessageMapper.Reflection.MessageMapper().CreateInstance() to create instances to put on the bus.

Our interfaces:

IOperationOccured - Contains basic operation information, subscribers to this event act on things in a fairly generic way. This event is never raised directly.

ISpecificOperationOccured - Inherits IOperationOccured. Contains more specific information. Subscribers to this event are able to do more specific things since the event is more specific.

The problem is that when ISpecificOperationOccured is raised, the handlers for IOperationOccured are called, the handlers for ISpecificOperationOccured are called and then the message appears to get processed again, calling the handlers again.

What am I misunderstanding? I'd expect the handlers for IOperationOccured to get called once per event and the handlers for ISpecificOperationOccured to get called once per event.