It seems that the modifier/lua-backend does not yet support flexible config krakend.

29 views
Skip to first unread message

Fikih Firmansyah

unread,
Jan 23, 2025, 11:27:34 PMJan 23
to KrakenD Community
Hello, I would like to ask how to make this extra config readable in the flexible config krakend?

backend-a.json (flexible config): 
        {
            "endpoint": "/using-lua",
            "output_encoding": "no-op",
            "backend": [
                {
                    "url_pattern": "/v1/3aecd459-27d2-45bc-9026-235fed9c41c0",
                    "host": ["https://mocki.io"],
                    "method": "GET",
                    "is_collection": true,
                    "encoding": "json",
                    "extra_config": {
                        "modifier/lua-backend": {
                            "sources": ["./lua/count.lua"],
                            "post": "count(response.load())",
                            "allow_open_libs": true
                        }
                    }
                }
            ],
            "extra_config": {
                "qos/ratelimit/router": {
                    "max_rate": 1,
                    "client_max_rate": 1,
                    "strategy": "ip",
                    "capacity": 1,
                    "every": "1s",
                    "client_capacity": -3
                }
            }
        },

krakend.json (output): 
{
        "endpoint": "/using-lua",
        "output_encoding": "no-op",
        "backend": [
            {
                "host": ["https://mocki.io"],
                "url_pattern": "/v1/3aecd459-27d2-45bc-9026-235fed9c41c0",
                "encoding": "json"
            }
        ]
    },

Thank you.

Jorge Tarrero

unread,
Jan 24, 2025, 3:41:38 AMJan 24
to KrakenD Community, Fikih Firmansyah
Hi Fikih,

I'm not able to reproduce your problem with the provided info: the output is correctly including the Lua config

Can you share more info about how are you arranging your config files and the command you're spawning to generate the output?
Reply all
Reply to author
Forward
0 new messages