njs icon indicating copy to clipboard operation
njs copied to clipboard

Add Support for js_balancer like balancer_by_lua_block

Open liaojianxiong opened this issue 1 year ago • 2 comments

Are there any plans to introduce a js_balancer function akin to balancer_by_lua_block found in the Lua Nginx Module (https://github.com/openresty/lua-nginx-module?tab=readme-ov-file#balancer_by_lua_block)? We rely on balancer_by_lua for dynamically selecting servers. For instance, we utilize server tagging across multiple upstreams and use variables as a switch to avoid selecting servers with specific tags during proxying. This balancer hook is highly beneficial. However, it seems that NJS lacks a comparable hook.

liaojianxiong avatar Feb 27 '24 08:02 liaojianxiong

Hi @liaojianxiong,

we plan to introduce js_balancer in the future. Thank you for the feedback. Speaking of priority, we plan to introduce a new JS engine first, before adding new features, like js_balancer.

xeioex avatar Feb 28 '24 23:02 xeioex

Thanks @xeioex , hope the new JS engine goes smoothly.

liaojianxiong avatar Feb 29 '24 08:02 liaojianxiong