-
Notifications
You must be signed in to change notification settings - Fork 543
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rust插件支持发送外部请求 #1376
Comments
这块已经有一个初步的实现,不过sdk还在优化中 cc @007gzs |
外部请求是指http_call么? |
@007gzs 是的, 还有就是http_call这个没法同步返回响应结果(body,status)? 只能走回调? |
受限于envoy的IO模型,wasm是没办法写同步风格的外部调用的(GO也不行)。 之前想过能不能通过JS Promise风格的API来简化外部调用,刚好昨天实现了一个原型, #1377 ,可以看下能不能满足需求http-dispatch-example |
看着可以, 我试试看 |
self.http_dispatcher.dispatch( panicked at /Users/rxwyun/Develop/rust/higress/plugins/wasm-rust/src/dispatcher.rs │ │ BadArgument一般是什么原因? |
这里httpbin是需要envoy有注册过这个cluster,如果没有配置话这里是没办法正确分配的 |
经过网关的原始请求的数据包大小超过30K后, 插件里面如果设置cache_response_body为true, 会直接影响原始请求响应的下发。 这个是什么原因? |
@johnlanni 网关缓存大小有限制么 |
应该是这个配置 |
我修改下试试 |
可以了,感谢 |
可以了解下最终形态么,我们也看下怎么优化HTTP调用这块 |
我记得这个是因为envoy的wasm必须实现ABI协议才行 之前做过尝试应该是不大行的 不知道higress能否脱离这个。 https://github.com/proxy-wasm/spec |
@cuisongliu 也是遵循这个ABI协议的,你是说基于wasi么,这个在envoy里不太现实。envoy本身有个eventloop,如果用wasi的异步IO,还需要在wasm里再起一个eventloop,两个eventloop之间目前无法联动。 |
最新版支持回调模式了,可以看下 higress/plugins/wasm-rust/extensions/demo-wasm/src/lib.rs Lines 97 to 131 in f8d62a8
|
Why do you need it?
Is your feature request related to a problem? Please describe in details
如题
How could it be?
A clear and concise description of what you want to happen. You can explain more about input of the feature, and output of it.
Other related information
Add any other context or screenshots about the feature request here.
The text was updated successfully, but these errors were encountered: