Exemplo n.º 1
0
        public void Should_get_connections()
        {
            var connections = managementClient.GetConnections();

            foreach (var connection in connections)
            {
                Console.Out.WriteLine("connection.name = {0}", connection.name);
                Console.WriteLine("user:\t{0}", connection.client_properties.user);
                Console.WriteLine("application:\t{0}", connection.client_properties.application);
                Console.WriteLine("client_api:\t{0}", connection.client_properties.client_api);
                Console.WriteLine("application_location:\t{0}", connection.client_properties.application_location);
                Console.WriteLine("connected:\t{0}", connection.client_properties.connected);
                Console.WriteLine("easynetq_version:\t{0}", connection.client_properties.easynetq_version);
                Console.WriteLine("machine_name:\t{0}", connection.client_properties.machine_name);
            }
        }
        public void Should_get_connections()
        {
            var connections = managementClient.GetConnections();

            foreach (var connection in connections)
            {
                Console.Out.WriteLine("connection.Name = {0}", connection.Name);

                ClientProperties clientProperties = connection.ClientProperties;

                Console.WriteLine("User:\t{0}", clientProperties.User);
                Console.WriteLine("Application:\t{0}", clientProperties.Application);
                Console.WriteLine("ClientApi:\t{0}", clientProperties.ClientApi);
                Console.WriteLine("ApplicationLocation:\t{0}", clientProperties.ApplicationLocation);
                Console.WriteLine("Connected:\t{0}", clientProperties.Connected);
                Console.WriteLine("EasynetqVersion:\t{0}", clientProperties.EasynetqVersion);
                Console.WriteLine("MachineName:\t{0}", clientProperties.MachineName);

                //Test the dynamic nature
                Console.WriteLine("Copyright:\t{0}", ((dynamic)clientProperties).Copyright);
            }
        }
Exemplo n.º 3
0
 public void OccasionallyKillConnections(IManagementClient client)
 {
     while (true)
     {
         Thread.Sleep(3000);
         var connections = client.GetConnections();
         foreach (var connection in connections)
         {
             Console.Out.WriteLine("\nKilling connection: {0}\n", connection.Name);
             client.CloseConnection(connection);
         }
     }
 }