分布式组件 gateway 网关

1.简介

网关作为流量的入口,常用功能包括路由转发、权限校验、限流控制。

XML 复制代码
spring:
  cloud:
    gateway:
      routes:
        - id: test_route
          uri: http://www.baidu.com
          predicates:
#访问的路径就是 如果是/hello?url=baidu  就转发到 https://www.baidu.com/hello?url=baidu
            - Query=url,https://www.baidu.com
        - id: test1_route
          uri: http://www.hao123.com
          predicates:
            - Query=url,hao123

bootstrap.yml

XML 复制代码
spring:
  application:
    name: gulimall-gateway
  cloud:
    nacos:
      config:
        server-addr: 192.168.2.36:8848
        namespace: 255b4d7d-a41d-4340-b4e0-8fcb111fc978
        group: dev
        file-extension: yaml

nacos config

XML 复制代码
spring:
  application:
    name: gulimall-gateway
  cloud:
    nacos:
      discovery:
        server-addr: 192.168.2.36:8848
server:
  port: 88

导入的依赖

XML 复制代码
    <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-gateway</artifactId>
        </dependency>

详细的后面在介绍

相关推荐
predisw1 小时前
Kafka broker 写消息的过程
分布式·kafka
曼彻斯特的海边2 小时前
RequestRateLimiterGatewayFilterFactory
spring cloud·gateway·限流
·云扬·2 小时前
【PmHub面试篇】Gateway全局过滤器统计接口调用耗时面试要点解析
面试·职场和发展·gateway
devil_mf3 小时前
gateway 网关 路由新增 (已亲测)
gateway
wmd131643067123 小时前
Gateway 搭建
gateway
找不到、了3 小时前
深入学习RabbitMQ队列的知识
分布式·rabbitmq
showmethetime3 小时前
RabbitMQ实用技巧
分布式·rabbitmq·ruby
KwokGuardian4 小时前
Seata 分布式事务 AT 模式
分布式
不爱学英文的码字机器5 小时前
[Git] 分布式版本控制 & 远程仓库协作
分布式·git
火龙谷5 小时前
【hadoop】Davinci数据可视化工具的安装部署
大数据·hadoop·分布式