alibaba / tengine

A distribution of Nginx with some advanced features
https://tengine.taobao.org
BSD 2-Clause "Simplified" License
12.82k stars 2.52k forks source link

Support proxy to Dubbo backend #1321

Open MengqiWu opened 5 years ago

MengqiWu commented 5 years ago

Introduce

Apache Dubbo™ is a high-performance, java based open source RPC framework.It is open source by Alibaba, in years of development, it is one of the most popular microservice framework.

There are Consumer(client) and Provider(Server) in Dubbo. This feature will support use Tengine as a proxy gateway, front get HTTP/HTTPS/HTTP2 request, and as a Dubbo Consumer pass the request to backend Dubbo Provider service.

  User                 tengine (dubbo_pass)                         Dubbo Service Provider
    |                          |                                              |
    |--- GET github.com:443 -->|                                              |
    |                          |--- Dubbo Multiplexing Binary RPC Request  -->|
    |                          |                                              |
    |                          |<-- Dubbo Multiplexing Binary RPC Response ---|
    |<--    HTTP/1.1 200    ---|                                              |

Plan

part 1 [doing] : support backend dubbo protocol to backend upstream (By MengqiWu)

  • [x] support dubbo_pass directive in location and multi directive in upstream, so can use tengine proxy http/https/http2 direct to raw dubbo service (hessian2 serialization).
  • [x] tengine will use one or more multiplexing connection communicate with dubbo service

part2 [waitting] : support service discovery from Zookeeper(Dubbo official) and Nacos(Open source by Alibaba)

  • [ ] support auto get backend server list to upstream from Zookeeper and Nacos, this may need add or del server in upstream
  • [ ] support auto discovery service from Zookeeper and Nacos, this may need add or del upstreams

part3 [planning] : support method mapping on tengine

  • [ ] support user-defined backend dubbo provider interface, so may need configure param mapping on tengine
tzssangglass commented 3 years ago

Is part2 work in progress?