Skip to content
/ dam Public
forked from cyejing/dam

High-Performance API Gateway

License

Notifications You must be signed in to change notification settings

Pual97/dam

 
 

Repository files navigation

Dam

Build codecov

Dam is High-Performance API Gateway

Features

  • Netty
  • 响应式网络处理
  • 路由表达式灵活匹配Http请求协议体
  • 灵活路由配置,功能可插拔配置
  • 基于SPI过滤器扩展,灵活扩展网关功能

Quick Start

EG: dam-example

Docs

网关处理逻辑

  1. 网关优先匹配global的路由,确定路由分组
  2. 按照路由顺序匹配分组里面的子路由
  3. 执行路由过滤器配置

路由配置说明

#route.yaml
routes:
  - id: 196105db9a384d7a93f8102ae46684cb  # 唯一Id
    group: test # 路由分组
    order: 100  # 路由匹配顺序
    global: true # 是否全局路由
    protocol: http # 路由协议
    expressionStr: Path.AntMatch('/replace/**') # 路由匹配表达式
    filterConfigs: # 路由过滤器配置
    - name: rewrite
      param:
        regex: "/replace/(.*)"
        replacement: "/$\\1"
    - name: proxy
      param:
        uri: "lb://test"
instances:
  - host: test
    address: localhost:4843 

Benchmark

fork from spring-cloud-gateway-bench gitee

TL;DR

Proxy Avg Latency Avg Req/Sec/Thread
dam 2.04ms 107.869k
gateway 4.68ms 43.827k
linkered 5.23ms 41.988k
zuul 11.08ms 22.757k
none 3.25ms 161.243k

About

High-Performance API Gateway

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 100.0%