Database Reference
In-Depth Information
}
}
}
So, when a submit payment is sent, we get an additional message on ServicePulse.
We can use conditional statements to check whether files are present, other messages are
present, and a number of conditions that can be reported as either passing or failing while
providing status information to ServicePulse for operations to take action.
In the CustomChecks class, we can also set a timer to periodically check for files using
the PeriodicCheck interface. This will set a timer to call the class back and send the
condition to ServicePulse. It operates differently from ReportPass as the condition
here is reported based on a timer. It will use the function PerformCheck() that it must
override; this will return CheckResult (either passed or failed) to inform ServicePulse.
We will check the status every 2 minutes in this example; depending on the seconds, it
will return a result as either passed or failed:
namespace PaymentEngine.PaymentProcessing
{
class CheckHealth : PeriodicCheck
{
public CheckHealth()
: base("PaymentProcessing Healthcheck",
"PaymentProcessing", TimeSpan.FromMinutes(2))
{
}
public override CheckResult PerformCheck()
{
// Fake a failure once in a while
if (DateTime.Now.Second % 2 == 0)
{
return
CheckResult.Failed("PaymentProcessing fake failure");
}
Search WWH ::




Custom Search