static void CheckBrokerStatus(Broker brokerModel, QueueSpy.Messages.BrokerStatus brokerStatus, CompareContext context) { if (!brokerStatus.IsResponding && brokerModel.ContactOK) { context.SendMessage(new Messages.BrokerEvent { EventTypeId = (int)EventType.BrokerContactLost, Description = "Broker Contact Lost." }); } if (brokerStatus.IsResponding && !brokerModel.ContactOK) { context.SendMessage(new Messages.BrokerEvent { EventTypeId = (int)EventType.BrokerContactEstablished, Description = "Broker Contact Established." }); } }
static void OnConnectionEstablished(QueueSpy.Messages.Connection connectionStatus, CompareContext context) { var vhost = context.GetStatusParent <Messages.VHost> (); context.SendMessage(new Messages.ConnectionEstablished { EventTypeId = (int)EventType.ConnectionEstablished, Description = string.Format("Connection '{0}' Established.", connectionStatus.Name), Name = connectionStatus.Name, VHostName = vhost.Name, Properties = connectionStatus.ClientProperties.ToDictionary(x => x.Key, x => x.Value) }); }