public void Verify_can_init_client_from_behavior_description()
        {
            IEnumerable <VirtualHostInfo> vhosts = HareDuClient
                                                   .Initialize(x =>
            {
                x.ConnectTo("http://localhost:15672");
                x.Logging(s =>
                {
                    s.Enable();
                    s.UseLogger("HareDuLogger");
                });
                x.UsingCredentials("guest", "guest");
                x.TransientRetry(s =>
                {
                    s.Enable();
                    s.Limit(3);
                });
            })
                                                   .Factory <VirtualHost>()
                                                   .GetAllAsync()
                                                   .Where(x => x.Name == "HareDu");

            foreach (var vhost in vhosts)
            {
                Console.WriteLine("Name: {0}", vhost.Name);
                Console.WriteLine("Tracing: {0}", vhost.Tracing);
                Console.WriteLine("****************************************************");
                Console.WriteLine();
            }
        }
Beispiel #2
0
 public void Setup()
 {
     Client = HareDuClient.Initialize(x =>
     {
         x.ConnectTo("http://localhost:15672");
         x.UsingCredentials("guest", "guest");
     });
 }
Beispiel #3
0
        public void Verify_can_init_client_from_settings_object()
        {
            var vhosts = HareDuClient
                         .Initialize(() => new HareDuClientSettingsImpl(
                                         "http://localhost:15672",
                                         new HareDuCredentialsImpl("guest", "guest")))
                         .Factory <VirtualHost>()
                         .GetAll()
                         .Where(x => x.Name == "HareDu");

            foreach (var vhost in vhosts)
            {
                Console.WriteLine("Name: {0}", vhost.Name);
                Console.WriteLine("Tracing: {0}", vhost.Tracing);
                Console.WriteLine("****************************************************");
                Console.WriteLine();
            }
        }
Beispiel #4
0
 public void Setup()
 {
     Client = HareDuClient.Initialize(x =>
     {
         x.ConnectTo("http://localhost:15672");
         x.Logging(s =>
         {
             s.Enable();
             s.UseLogger("HareDuLogger");
         });
         x.UsingCredentials("guest", "guest");
         x.TransientRetry(s =>
         {
             s.Enable();
             s.Limit(3);
         });
     });
 }
Beispiel #5
0
        public void Verify_can_init_client_from_json()
        {
//            string config;
//
//            using (StreamReader reader = File.OpenText("/users/albert/documents/git/haredu_config.txt"))
//            {
//                config = reader.ReadToEnd();
//            }

            string config = @"{
	'rmqServerUrl':'http://localhost:15672',
            'timeout':'00:00:50',
            'logger':{
                'enable':true,
                'name':'HareDuLogger'
            },
            'credentials':{
                'username':'******',
                'password':'******'
            },
            'transientRetry':{
                'enable':true,
                'limit':3
            }
        }";

            IEnumerable <VirtualHostInfo> vhosts = HareDuClient
                                                   .Initialize(config)
                                                   .Factory <VirtualHost>()
                                                   .GetAll()
                                                   .Where(x => x.Name == "HareDu");

            foreach (var vhost in vhosts)
            {
                Console.WriteLine("Name: {0}", vhost.Name);
                Console.WriteLine("Tracing: {0}", vhost.Tracing);
                Console.WriteLine("****************************************************");
                Console.WriteLine();
            }
        }