求助,想做一个api gateway,支持thrift rpc,求指教!

507 views
Skip to first unread message

Tonny Luo

unread,
May 25, 2016, 11:17:26 PM5/25/16
to openresty
    由于对lua及openresty理解不是很深刻,想在这里与大家一起讨论学习下。
    我原来用lua做了个http 动态反向代理(https://github.com/luohoufu/httpproxy)的东西,算是自己在openresty及lua上的第一次实践。
   
    openresty对http协议的支持是相当好的,开发起来也方便,但我在讨论列表中搜索只找到了对thrift支持为数不多的几篇帖子。
   
    https://groups.google.com/forum/#!searchin/openresty/cosocket$20thrift/openresty/Te-1ms4uDTc/brjdZ7rFBQAJ
    https://groups.google.com/forum/#!searchin/openresty/thrift/openresty/N7A44_rt-5M/fAAZOSX5BwAJ
    https://groups.google.com/forum/#!searchin/openresty/thrift/openresty/UgeHqqlRiYo/y0dywZIFBwAJ
 
    目前,项目有了些变化。为了提高java及php程序间的执行性能,引入了thrift通讯。对原来http反向代理有了新的要求。
    通过http(http/2)来连接openresty,再由openresty对ThriftServer建立长连接,然后将Thrift结果解析为json响应。
    Openresty是高性能在于 event-driven, asynchronous, single-threaded, non-blocking ,该如何结合Thrift的TCompactProtocol、TNonblockingTransport、NonblockingServer做成高性能的?
   
   同时,具体是在lua里实现,还是在c里实现?

   讨论组里有相关经验的老师,麻烦指导我一下。
   另外,我想深入学习入lua及openresty,推荐一下学习的github项目及book。

   不胜感谢!

Kwanhur Huang

unread,
May 26, 2016, 11:58:22 AM5/26/16
to open...@googlegroups.com, Kwanhur Huang

Yifei Kong

unread,
Nov 1, 2017, 1:43:33 AM11/1/17
to openresty
thrift 感觉更底层一些, 现有的基于openresty的api gateway指的似乎都是面向外部的http rest API, 不知道有没有其他解决方案.
Reply all
Reply to author
Forward
0 new messages