• 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

  • 相关阅读:
    *args和**kwargs
    事件驱动模型
    同步异步和阻塞非阻塞
    多进程和多线程
    认识tornado(五)
    认识tornado(四)
    认识tornado(三)
    [GO]使用select实现超时
    [GO]使用select实现斐波那契
    [GO]ticker的使用
  • 原文地址:https://www.cnblogs.com/tianlifitting/p/8572523.html
Copyright © 2020-2023  润新知