Coder Social home page Coder Social logo

jljlpch / ms-gateway Goto Github PK

View Code? Open in Web Editor NEW

This project forked from rucky2013/ms-gateway

0.0 2.0 0.0 10 KB

基于Netty实现轻量级的微服务通讯网关。主要实现了安全、流控、代理、路由等功能。

License: MIT License

Java 100.00%

ms-gateway's Introduction

微服务网关(ms-gateway)

目录 [TOC]

QQ交流群:191958521(微服务基础设施)

微服务网关开源地址:

微服务基础设施开源项目:

##一、背景/功能介绍 ###1.1 背景介绍

###1.2 功能介绍 网关是一个所有流量的入口,给人太多的想象空间,因此我将网关的所有功能分解为:核心功能与扩展功能。这样分解的目的是为了把握核心,其余的都统一作为扩展功能进行逐一完善。 ####1.2.1 核心功能

  • **安全:**主要包括HTTPS、IP黑白名单
  • **流量控制(流量整形):**并发控制、流量速率控制
  • **请求代理:**HTTP请求代理
  • **静/动态路由:**动态路由、静态路由

####1.2.2 扩展功能

  • **超时控制:**整体处理超时控制

##二、核心设计 ###2.1 安全 ####2.1.1 HTTP/HTTPS 提供了HTTP或HTTPS的方式接入微服务网关,通过配置文件参数配置进行切换模式。

####2.1.2 IP黑/白名单 提供了基于IP黑/白名单的接入者控制。

####2.1.3 OAuth2.0

[暂不考虑]

####2.1.4 账号/密码认证

[暂不考虑]

###2.2 流量控制 ####2.2.1 并发控制

  • **资源层控制:**基于Netty线程大小进行并发数的控制
  • **流控层控制:**基于JDK型号量Semphore来实现并发流量的控制。该参数只能小于等于资源层的控制参数(Netty线程数)

####2.2.2 流速控制 基于Google开源Guava项目总的RateLimiter进行流速的控制。

###2.3 请求代理 通过Netty的方式实现向后端转发HTTP请求。

###2.4 静/动态路由 静态路由与动态路由二选一的模式进行使用。

2.4.1 静态路由

通过配置文件配置的方式实现路由表(路由清单)的配置。

2.4.2 动态路由

通过注册中心的方式动态化获取路由表的配置信息。

##三、如何使用

3.1 引入MAVEN依赖

[待定]

3.2 修改配置文件

[待定]

3.3 启动微服务网关

[待定]

3.4 打开浏览器测试

[待定]

##四、发布痕迹

发布日期 版本号 变更信息
2016-10-28 V1.0.0 ①描述文档撰写②项目的规划③框架的搭建

##五、性能报告

  • 压测机器:
  • 压测工具:AB工具
  • 压测时间:2016-10-28
  • 最大并发数:
  • 平均TPS/响应耗时:

###5.1 并发量(CV)

###5.2 交易量(TPS)

###5.3 响应耗时(RT)

ms-gateway's People

Contributors

yu120 avatar

Watchers

 avatar  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.