flomesh-io / pipy

Pipy is a programmable proxy for the cloud, edge and IoT.
https://flomesh.io/pipy
Other
743 stars 70 forks source link

HTTP response code based failovers with caching #115

Closed kickthemooon closed 1 year ago

kickthemooon commented 1 year ago

Could I achieve HTTP response code based failovers with caching using pipy?

What I mean is

Is this something I could do with pipy?

pajama-coder commented 1 year ago

This is a common requested feature but unfortunately, it's pretty hard to do in Pipy right now because the core logic that is involved here is some kind of loops in the pipelines, which is not implemented yet. However, we do have plans to support loops. We've come up with some ideas on the design actually. Hopefully it'll be done in the coming releases.

pajama-coder commented 1 year ago

@kickthemooon With the latest commit ecbd3b03f53c21d8852e85968936ea69e68c77cc, a new filter replay() is introduced, by which the logic you are looking to can be implemented. Also, the 'unhealthy' parameter for LoadBalancers can be useful to skip ill-responding backends. Please checkout out the builtin reference doc for the new replay() filter for detailed explanation on how to use it. You can also find an example there.

naqvis commented 1 year ago

Hi @kickthemooon Requested feature has been added. Can you please help to confirm if it fulfills your use case?

naqvis commented 1 year ago

Closing this issue, as looping construct is included in latest version of pipy.