shunsheng-github edited a comment on issue #1152: request help: fail to 
mqtt-proxy  request
URL: 
https://github.com/apache/incubator-apisix/issues/1152#issuecomment-590903371
 
 
   原始mqtt服务器连接:
   
![image](https://user-images.githubusercontent.com/61373502/75256877-1d7a3480-581f-11ea-900e-b9092af765ef.png)
   apisix服务器路由配置:
   
   ```
   curl http://10.97.1.84:9180/apisix/admin/stream_routes/103 -X PUT -d '
   {
       "remote_addr": "127.0.0.1",
       "plugins": {
           "mqtt-proxy": {
               "protocol_name": "MQTT",
               "protocol_level": 4,
               "upstream": {
                   "ip": "192.168.209.243",
                   "port": 1883
               }
           }
       }
   }'
   ```
   
   
![image](https://user-images.githubusercontent.com/61373502/75257045-5b775880-581f-11ea-97d2-9f28253c8c2b.png)
   这里是tcp://IP:9100是连接不成功,并且日志错误还是这个错误:
   2020/02/25 22:30:58 [error] 30514#30514: *15072954 lua entry thread aborted: 
runtime error: /usr/local/apisix/lua/apisix/stream/router/ip_port.lua:31: 
attempt to index local 'route' (a boolean value)
   stack traceback:
   coroutine 0:
        /usr/local/apisix/lua/apisix/stream/router/ip_port.lua: in function 
'match_opts'
        /usr/local/apisix/lua/apisix/stream/router/ip_port.lua:60: in function 
'match'
        /usr/local/apisix/lua/apisix.lua:521: in function 'stream_preread_phase'
        preread_by_lua(nginx.conf:51):2: in main chunk while prereading client 
data, client: 192.168.221.136, server: 0.0.0.0:9100
   
从配置来看应该是tcp://IP:9100,事实上通过9100端口是连接不上apisix服务器。上面的测试用例没看到应用端是怎么连接apisix服务器的,不太理解这个stream
 route调用方式。
   换了另一台服务器后:做同样的动作,tcp://10.97.1.83:9100,同样连接不上,日志如下:
   192.168.221.167 - - [26/Feb/2020:08:42:23 +0800] - 
"\x10#\x00\x04MQTT\x04\x02\x00<\x00\x17paho1582677649626000002" 400 154 0.006 
"-" "-" - - -
   192.168.221.167 - - [26/Feb/2020:08:42:23 +0800] - 
"\x10%\x00\x06MQIsdp\x03\x02\x00<\x00\x17paho1582677649626000002" 400 154 0.007 
"-" "-" - - -

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to