local function choose_backend(applet)
local queryParam = applet.qs
core.Info("params"..queryParam)
if string.match(queryParam,"value1") then
return "backend1"
else
return "backend2"
end
end
core.register_service("choose_backend","http",choose_backend)
core.register_service也无法动态选择后端
================================================ ==================================================
我已经使用core.register_fetches选择后端,但是在使用txn对象获取查询参数时遇到了问题。
core.register_fetches("choose_backend", function(txn)
if string.match(querparam,"value1") then
return "backend1"
else
return "backend2"
end
end)