Last active
August 29, 2015 14:01
-
-
Save DavidBoike/ff420add0138b6b6c9d9 to your computer and use it in GitHub Desktop.
Error Notifier for ServiceControl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<MessageEndpointMappings> | |
<add Messages="ServiceControl.Contracts" Endpoint="Particular.ServiceControl" /> | |
</MessageEndpointMappings> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace ErrorNotify | |
{ | |
using NServiceBus; | |
/* | |
This class configures this endpoint as a Server. More information about how to configure the NServiceBus host | |
can be found here: http://particular.net/articles/the-nservicebus-host | |
*/ | |
public class EndpointConfig : IConfigureThisEndpoint, AsA_Server, IWantCustomInitialization | |
{ | |
public void Init() | |
{ | |
Configure.Serialization.Json(); | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using NServiceBus; | |
using ServiceControl.Contracts.MessageFailures; | |
namespace ErrorNotify | |
{ | |
public class ErrorNotifyCheck : IHandleMessages<MessageFailed> | |
{ | |
public void Handle(MessageFailed message) | |
{ | |
// URL to launch ServiceInsight | |
string serviceInsightUrl = String.Format("si://servicecontrolurl?Search={0}", message.FailedMessageId); | |
// Build the email here | |
Console.WriteLine("Hey someone should check out this {0}!", message.FailureDetails.Exception.ExceptionType); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment