Springcloud_ad-gateway微服务网关(zuul)方式restAPI,以及zuul网关配置




zuul的生命周期:

过滤器:1,pre filters:路由之前调用,身份验证,记录调试信息

              2,routing filters:用于构造发送给微服务的请求

              3,post filters:路由到微服务之后执行

              4,error filters:错误类型过滤器

              5,custom filters自定义过滤器

 


<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

    <!-- 鎸囧畾鐖秔om, 鍦ㄧ埗pom涓厤缃瓙妯″潡鐨勫叕鍏变緷璧?-->
    <parent>
        <artifactId>imooc-ad</artifactId>
        <groupId>com.imooc.ad</groupId>
        <version>1.0-SNAPSHOT</version>
    </parent>

    <modelVersion>4.0.0</modelVersion>

    <!-- 褰撳墠椤圭洰/妯″潡鐨勫潗鏍? groupId浠庣埗妯″潡涓户鎵?-->
    <artifactId>ad-gateway</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>jar</packaging>

    <!-- 妯″潡鍚嶅強鎻忚堪淇℃伅 -->
    <name>ad-gateway</name>
    <description>ad-gateway</description>

    <dependencies>
        <!--
            Eureka 瀹㈡埛绔? 瀹㈡埛绔悜 Eureka Server 娉ㄥ唽鐨勬椂鍊欎細鎻愪緵涓€绯诲垪鐨勫厓鏁版嵁淇℃伅, 渚嬪: 涓绘満, 绔彛, 鍋ュ悍妫€鏌rl绛?            Eureka Server 鎺ュ彈姣忎釜瀹㈡埛绔彂閫佺殑蹇冭烦淇℃伅, 濡傛灉鍦ㄦ煇涓厤缃殑瓒呮椂鏃堕棿鍐呮湭鎺ユ敹鍒板績璺充俊鎭? 瀹炰緥浼氳浠庢敞鍐屽垪琛ㄤ腑绉婚櫎
        -->
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
        </dependency>
        <!-- 鏈嶅姟缃戝叧 -->
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-netflix-zuul</artifactId>
        </dependency>
    </dependencies>

    <!--
        SpringBoot鐨凪aven鎻掍欢, 鑳藉浠aven鐨勬柟寮忎负搴旂敤鎻愪緵SpringBoot鐨勬敮鎸侊紝鍙互灏?        SpringBoot搴旂敤鎵撳寘涓哄彲鎵ц鐨刯ar鎴杦ar鏂囦欢, 鐒跺悗浠ラ€氬父鐨勬柟寮忚繍琛孲pringBoot搴旂敤
     -->
    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>

</project>







 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

择业

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值