zoukankan      html  css  js  c++  java
  • spring cloud 网管篇zuul

    1, consul

    2, zuul 程序的yml 文件

    server:
    port: 8083
    spring:
    application:
    name: zuulInfo # 应用名称
    cloud:
    consul:
    host: localhost
    port: 8500
    discovery:
    service-name: ${spring.application.name}
    zuul:
    routes:
    test:
    url: http://localhost:8086
    api-a:
    path: /api-a/**
    serviceId: testInfo


    3,zuul 程序的pom文件

    <dependency>
    <groupId>org.springframework.cloud</groupId>
    <artifactId>spring-cloud-starter-consul-discovery</artifactId>
    </dependency>

    <dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-actuator</artifactId>
    </dependency>

    <dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-web</artifactId>
    </dependency>

    <dependency>
    <groupId>org.springframework.cloud</groupId>
    <artifactId>spring-cloud-starter-netflix-zuul</artifactId>
    </dependency>



    4, zuul 程序注解

    @EnableDiscoveryClient
    @EnableZuulProxy
    @SpringBootApplication
    public class ZuulGateWayApplication {

    public static void main(String[] args) {
    SpringApplication.run(ZuulGateWayApplication.class, args);
    }

    }




  • 相关阅读:
    perl的eval语句
    PythonWin运行出错解决办法
    python多重继承
    perl调用shell
    python正则表达式匹配中文
    perl学习2处理用户输入
    awk介绍
    perl学习3qw及数组的应用
    perl的多线程
    perl学习5子程序中自动识别参数
  • 原文地址:https://www.cnblogs.com/bruce1992/p/13875764.html
Copyright © 2011-2022 走看看