zoukankan      html  css  js  c++  java
  • sping cloud微服务中zuul路由

    不论是使用传统路由的配置方式还是服务路由的配置方式,我们都需要为每个路由规则定义匹配表达式;

         ? 匹配任意的单个字符   URL路径 /user-service/?    匹配比如: /user-service/a 、 /user-service/b 、 /user-service/c

         *匹配任意数量的字符                   /user-service/*                        /user-service/a 、 /user-service/abc 、 /user-service/efg 。但是它无法匹配 /user-service/a/b

         **匹配任意数量的字符,支持多级目录                                        /user-service/a/b 

          如果我们不希望 /hello 接口被路由::

                  zuul.ignored-patterns=/**/hello/**

                  zuul.routes.api-a.path=/api-a/**

                  zuul.routes.api-a.serviceId=hello-service

          实际配置  zuul:
                             routes:
                                user-service:
                                      path: /basic/**
                                      service-id: channel-basic-service
                               order-service:
                                      path: /order-service/**
                                      service-id: channel-order-service

         通过网关来访问 hello-service 的 /hello 接口: http://localhost:8888/api-a/hello

  • 相关阅读:
    string截断
    winform截屏
    android自定义tabhost,tabcontent用intent获得
    Eclipse引入jar包的三种方式
    jquery dataTable的学习
    jquery datatable 参数
    Sql Server中三种字符串合并方法的性能比较
    sql表设计
    开发守则
    App Store2016年最新审核规则
  • 原文地址:https://www.cnblogs.com/tianlifitting/p/8572523.html
Copyright © 2011-2022 走看看