Skip to content

ABI to customize upstream/origin selection #16

@ElvinEfendi

Description

@ElvinEfendi

EDIT1: The example code for reproducing is at https://github.com/ElvinEfendi/envoy-wasm-regional-routing.

I have been experimenting with https://github.com/proxy-wasm/proxy-wasm-rust-sdk recently. I want to write a filter that for a given request, dynamically picks what Envoy cluster the request should be proxied to.

I tried using cluster_header: region routing functionality of Envoy and was hoping I could dynamically change the header value in the plugin. But that did not work as I expected. Turns out self.set_http_request_header(&"region", Some(&"us_central1")); changes/sets the header only for the upstream. Envoy's router does not see the updated value when making routing decision.

Is this an expected behaviour? If so, is there any plan to introduce a dedicated ABI for customizing Envoy's routing decision when it comes to upstream/cluster selection?

FWIW this seems to be possible with a Lua filter: https://medium.com/safetycultureengineering/edge-routing-with-envoy-and-lua-621f3d776c57

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions