Support outbound call within Envoy's cluster from Golang filter
Title: Support outbound call within Envoy's cluster from Golang filter
Description: Currently, when there is a need to make outbound calls within Golang filter, the filter will handle by itself which is unfortunate that the current implementation cannot utilize Envoy's full capabilities, such as circuit-breaking, retry mechanisms, locality-aware routing, and other advanced features.
In comparison to the Lua filter, which has been supported through httpcall.
[optional Relevant Links:]
Any extra documentation required to understand the issue.
cc @doujiang24
Thanks, the API does make sense. But not a high priority for me now, patches/volunteers are welcome~
This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in the next 7 days unless it is tagged "help wanted" or "no stalebot" or other activity occurs. Thank you for your contributions.
@wbpcode please add no-stale, thanks
Hi @doujiang24,
I’m curious about what it would take to implement this. Which Envoy API call needs to be wrapped? Is there a similar example we could reference? Thanks.
Hi @chenwan0036
There isn't a simple Envoy API to be wrapped, here are the key points:
- we have to implement Envoy C++ API, similar to Lua: https://github.com/envoyproxy/envoy/blob/main/source/extensions/filters/http/lua/lua_filter.cc#L156-L187
- after Golang invoke the Envoy C++ API, Golang should yield and wait Envoy call Golang to resume, i.e. https://github.com/envoyproxy/envoy/blob/main/contrib/golang/filters/http/source/golang_filter.cc#L1037
@doujiang24, thank you for your response. I’ve realized it’s more complex than I initially thought. I tried implementing an HTTP call (key point 1), but it was tougher than I expected, and I didn’t make much progress. This experience gave me a new appreciation for filter development and your work—it's truly impressive.