You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2022/03/10 16:12:43 UTC

[GitHub] [apisix] zhixiongdu027 opened a new issue #6570: feat: How to make apisix be the gateway for tars

zhixiongdu027 opened a new issue #6570:
URL: https://github.com/apache/apisix/issues/6570


   ### Issue description
   
   # Feat: How to make apisix be the gateway for tars
   
   ## Background:
   
   TARS is a Linux Foundation project. It is a high-performance RPC framework based on name service and Tars protocol, also integrated administration platform, and implemented
   hosting-service via flexible schedule.
   
   Now I want to implement Tars proxy function with apisix, and make apisix be the gateway for tars
   
   ## What does it look like:
   
   ### a service discovery plugin (can both work in http module and stream module)
   
   rpc calls to tars are addressed through servants. this discovery plugin will provide translation services from servants to nodes, like:
   
   ```lua
     local function discovery.nodes("Test.TestServer.HelloObj")
       return {
         { host = "172.16.8.33", port = 12334, weight =100,},
         { host = "172.16.8.33", port = 12334, weight =100,},
       }
     end
   ```
   
   ### a tars http proxy
   
   There are two problems in providing tcp services externally:
   
   1. Limited exposed ports 
   2. Poor synergy with different frameworks
   
   So there needs to be a gateway to provide http->tcp conversion and proxy
   Tars already has an official TarsGateway to do this work, I will refer to it to implement APISix Tars Proxy
   
   ### a tars tcp proxy
   
   It is also necessary to support tcp proxy:
   
   + RPC request proxy in the environment of internal and external network isolation
   + gateway can support server push
   
   ## How to use this:
   
   ### discovery configuration as follows:
   
   ```yaml
   discovery:
     tars:
       db_conf:
         host: 172.16.1.99
         port: 3306
         database: db_tars
         user: tars
         password: tars2022    
   ```
   
   ### http proxy configuration as follows:
   configuration format is based on TarsGateway, with slight changes
   ```yaml
     tars-proxy:
       hosts: [ "*.tars.com","a.rpc.com" ]
       tup_uri: /tup
       json_uri: /tup-json
       auto_proxy: false
       default:
         balancer: chash
         hash_on: head
         key: XGUID
         timeout:
           connect: 1000
           send: 1000
           read: 1000
         discovery: tars
         forward_headers: [ "XGUID","REMOTE_IP" ]
       proxy:
         hello:test:
           servant: Test.TestServer.HelloObj
           nodes:
             - host: 172.16.33.8
               port: 9927
         hello:
           servant: Test.TestServer.HelloObj
         sum:
           servant: Test.GetSumServer.GetSumObj
           balancer: roudrobin
         user:
           servant: Test.GetSumServer.GetSumObj
           discovery: k8s
           forward_headers: [ "GUID" ]
   ```
   
   ### tcp proxy configuration as follows:
   todo


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] spacewander commented on issue #6570: feat: How to make apisix be the gateway for tars

Posted by GitBox <gi...@apache.org>.
spacewander commented on issue #6570:
URL: https://github.com/apache/apisix/issues/6570#issuecomment-1064668365


   We need a C or Lua SDK for tars. Would you like to contribute this feature?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] zhixiongdu027 edited a comment on issue #6570: feat: How to make apisix be the gateway for tars

Posted by GitBox <gi...@apache.org>.
zhixiongdu027 edited a comment on issue #6570:
URL: https://github.com/apache/apisix/issues/6570#issuecomment-1078846479


   different programs solve different problems
   
   one gateway proxy all requests is better than propagating to multiple gateways
   
   @shoulda 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] shoulda commented on issue #6570: feat: How to make apisix be the gateway for tars

Posted by GitBox <gi...@apache.org>.
shoulda commented on issue #6570:
URL: https://github.com/apache/apisix/issues/6570#issuecomment-1077363863


   Now that there exists TarsGateway, why does you choose apisix ? @ @zhixiongdu027 😂


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] zhixiongdu027 commented on issue #6570: feat: How to make apisix be the gateway for tars

Posted by GitBox <gi...@apache.org>.
zhixiongdu027 commented on issue #6570:
URL: https://github.com/apache/apisix/issues/6570#issuecomment-1064674278


   yes. 
   I have implemented the incomplete encoding and decoding of the tars protocol in C language, 
   but it is enough as a proxy.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] zhixiongdu027 edited a comment on issue #6570: feat: How to make apisix be the gateway for tars

Posted by GitBox <gi...@apache.org>.
zhixiongdu027 edited a comment on issue #6570:
URL: https://github.com/apache/apisix/issues/6570#issuecomment-1078846479


   
   one gateway proxy all requests is better than propagating to multiple gateways
   
   @shoulda 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org