Git Product home page Git Product logo

springcloudgateway-nacos-demo's Introduction

SpringCloudGateway-Demo

SpringCloud Gateway简介

SpringCloud Gateway该项目提供了一个用于在Spring MVC之上构建API网关的库,建立在Spring Framework 5,Project Reactor和Spring Boot 2.0之上。Spring Cloud Gateway旨在提供一种简单而有效的方法来路由到API,并为它们提供跨领域的关注,例如:安全性,监视/指标和弹性。

关于Demo

本Demo提供一个单机的网关例子,注册中心使用阿里巴巴的Nacos。 由于Nacos也提供配置中心,因此结合网关更容易做到动态配置,可以在配置中启动。

支持以下功能

  • 基于Nacos动态配置路由
  • IP黑名单过滤
  • 鉴权过滤器
  • 断路器配置,回调
  • 支持修改请求body
  • 支持修改响应body
  • 自定义异常处理器

依赖&版本

  • Maven
  • JDK8+
  • SpringBoot 2.2.0
  • SpringCloud Greenwich.SR3

主要目录结构

  • config 配置文件,包括自定义异常处理的配置以及动态路由配置
  • exception 异常处理的具体实现
  • filter
    • factory 局部拦截器,包含修改body,鉴权等
    • global 全局拦截器,包含IP拦截
  • route 动态路由的实现
  • service IP拦截以及鉴权的具体实现
  • predicate 预言

springcloudgateway-nacos-demo's People

Contributors

singletigger avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.