Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

help request: Are there any examples of custom balancer? #11876

Open
k359792067 opened this issue Dec 30, 2024 · 0 comments
Open

help request: Are there any examples of custom balancer? #11876

k359792067 opened this issue Dec 30, 2024 · 0 comments
Labels
question label for questions asked by users

Comments

@k359792067
Copy link

k359792067 commented Dec 30, 2024

Description

I wrote a custom balancer like mqtt_custom.lua and placed it in the apisix/balancer directory, hoping to use it with mqtt-proxy plugin, but it didn't work. I see

user-defined load balancer loaded via require("apisix.balancer.your_balancer")

in the document, but the specifics are missing. Are there any relevant examples I can refer to?

  1. PUT /apisix/admin/stream_routes/1
    "plugins": {
        "mqtt-proxy": {
            "protocol_name": "MQTT",
            "protocol_level": 4
        }
    },
    "upstream": {
        "type": "mqtt_custom",
        "nodes": [
            {
                "host": "192.168.x.x",
                "port": 1883,
                "weight": 1
            },
            {
                "host": "192.168.x.x",
                "port": 2883,
                "weight": 1
            }
        ]
    }
}

Environment

  • APISIX version (run apisix version): 3.9.1 (docker-compose deployed)
  • Operating system (run uname -a): Linux 59018549cd9d 6.1.21.2-microsoft-standard-WSL2+ change: added an example of plugin. #2 SMP Wed Dec 4 10:45:58 CST 2024 x86_64 GNU/Linux
  • OpenResty / Nginx version (run openresty -V or nginx -V):nginx version: openresty/1.25.3.1
@dosubot dosubot bot added the question label for questions asked by users label Dec 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question label for questions asked by users
Projects
Status: 📋 Backlog
Development

No branches or pull requests

1 participant