Processing messages
After configuring our queue
and exchange
, we then subscribe to both the deployment start and stop messages. When our deployment start message arrives, we kick off our timer. If the deployment stop message arrives prior to our time limit, we will stop the timer without incident. If the deployment stop message does not arrive prior to our time limit, we will alert the user:
public void ProcessDeploymentStartMessage (DeploymentStartMessage msg) { __deploymentTimer.Stop(); __deploymentTimer.Start(); } public void ProcessDeploymentStopMessage(DeploymentStopMessage msg) { __deploymentTimer.Stop(); }
Publishing health status messages
When our health timer elapses, our _healthTimer_Elapsed
method will be called. When this happens, we will create our HealthStatusMessage
with all the information populated, and then publish the message. Remember, no DateTime
. Now, anywhere within our codebase:
private void _healthTimer_Elapsed(object sender, ElapsedEventArgs e) { HealthStatusMessage...