static void OnNewQueue(QueueSpy.Messages.Queue queueStatus, CompareContext context) { var vhost = context.GetStatusParent <Messages.VHost> (); context.SendMessage(new Messages.QueueCreated { EventTypeId = (int)EventType.QueueCreated, Description = string.Format("New queue created: {0}", queueStatus.Name), Name = queueStatus.Name, VHostName = vhost.Name }); }
static void OnNewConsumer(QueueSpy.Messages.Consumer consumer, CompareContext context) { var connection = context.GetStatusParent <Messages.Connection> (); context.SendMessage(new Messages.NewConsumer { EventTypeId = (int)EventType.NewConsumer, Description = string.Format("Consumer started consuming from queue {0}", consumer.QueueName), ConnectionName = connection.Name, Tag = consumer.Tag, QueueName = consumer.QueueName }); }
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) }); }