NServiceBus icon indicating copy to clipboard operation
NServiceBus copied to clipboard

Errors when subscribing to MessageFailed from ServiceControl

Open Bishbulb opened this issue 12 years ago • 1 comments

I am trying to implement an NServiceBus handler that subscribes to message failures and then emails a system administrator. I got everything up and running by adding the following configuration to my handler: <MessageEndpointMappings> <add Messages="ServiceControl.Contracts.MessageFailures.MessageFailed,ServiceControl.Contracts" Endpoint="Particular.ServiceControl" /> </MessageEndpointMappings>

I added a reference to ServiceControl.Contracts.dll, which (as I understand it) is the public contract that should be used for integrations.

This works fine, and I am able to handle the MessageFailed type properly. The problem is that ServiceControl is also delivering messages of type MessageFailedRepeatedly to my handler because MessageFailedRepeatedly inherits from MessageFailed. Since ServiceControl.Contracts.dll does not include MessageFailedRepeatedly, I get deserialization exceptions from this endpoint when a MessageFailedRepeatedly event comes in.

It seems like ServiceControl.Contracts.dll should either include MessageFailedRepeatedly, or else MessageFailedRepeatedly should not inherit from MessageFailed.

Any suggestions on how I can work around this problem?

Bishbulb avatar Jul 25 '14 14:07 Bishbulb

@Bishbulb please raise this issue against the ServiceControl repo here

johnsimons avatar Jul 27 '14 23:07 johnsimons