Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            string registerUrl = ConfigurationManager.AppSettings["registerUrl"];
            string redisServer = ConfigurationManager.AppSettings["redisServer"];
            int redisDatabaseIndex = int.Parse(ConfigurationManager.AppSettings["redisDatabaseIndex"]);

            RedisDirectoryBuilder builder = new RedisDirectoryBuilder(registerUrl, redisServer, redisDatabaseIndex);

            var myselfInfo = new MySelfInfo()
            {
                Description = "Demo提供者",
                Directory = "DemoProvider",
                Ip = "127.0.0.1:4001",
                Status = 1,
                Url = "http://127.0.0.1:4001",
                Weight = 100
            };

            builder.Build(myselfInfo, new string[0], new string[2] { "test/api1", "test/api2" });

            Console.ReadLine();



        }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            string registerUrl = ConfigurationManager.AppSettings["registerUrl"];
            string redisServer = ConfigurationManager.AppSettings["redisServer"];
            int redisDatabaseIndex = int.Parse(ConfigurationManager.AppSettings["redisDatabaseIndex"]);

            RedisDirectoryBuilder builder = new RedisDirectoryBuilder(registerUrl, redisServer, redisDatabaseIndex);

            var myselfInfo = new MySelfInfo()
            {
                Description = "Demo消费者",
                Directory = "DemoConsumer",
                Ip = "192.168.1.1:4000",
                Status = 1,
                Url = "http://192.168.1.1:3000",
                Weight = 200
            };
            builder.Build(myselfInfo, new string[2] { "DemoProvider", "ProviderAndConsumer" });

            Console.ReadLine();
        }