kayx23 commented on code in PR #13310:
URL: https://github.com/apache/apisix/pull/13310#discussion_r3198846928


##########
docs/en/latest/plugins/mqtt-proxy.md:
##########
@@ -70,101 +73,409 @@ admin_key=$(yq '.deployment.admin.admin_key[0].key' 
conf/config.yaml | sed 's/"/
 
 :::
 
+### Proxy to a MQTT Broker
+
+The following example demonstrates how you can configure a stream Route to 
proxy traffic to a hosted MQTT server and verify that APISIX can proxy MQTT 
messages successfully.
+
+Create a stream Route to the MQTT server and configure the `mqtt-proxy` Plugin:
+
+<Tabs
+groupId="api"
+defaultValue="admin-api"
+values={[
+{label: 'Admin API', value: 'admin-api'},
+{label: 'ADC', value: 'adc'},
+{label: 'Ingress Controller', value: 'aic'}
+]}>
+
+<TabItem value="admin-api">
+
 ```shell
-curl http://127.0.0.1:9180/apisix/admin/stream_routes/1 -H "X-API-KEY: 
$admin_key" -X PUT -d '
-{
+curl "http://127.0.0.1:9180/apisix/admin/stream_routes"; -X PUT \
+  -H "X-API-KEY: ${admin_key}" \
+  -d '{
+    "id": "mqtt-route-proxy",
     "plugins": {
-        "mqtt-proxy": {
-            "protocol_name": "MQTT",
-            "protocol_level": 4
-        }
+      "mqtt-proxy": {
+        "protocol_name": "MQTT",
+        "protocol_level": 4
+      }
     },
     "upstream": {

Review Comment:
   These Admin API examples use `PUT /apisix/admin/stream_routes` with the 
route `id` in the request body, but the stream route Admin API in this repo is 
documented and implemented as `PUT /apisix/admin/stream_routes/{id}`. See 
`docs/en/latest/admin-api.md` and `apisix/admin/stream_routes.lua`. Please 
update the Admin API examples in this doc (same issue appears multiple times, 
and also in the ZH file).



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to