I try to bridge emqx to RabbitMQ(mqtt-plugin) with the following config:
bridge.example.start_type = auto
bridge.example.reconnect_interval = 15s
bridge.example.address = 127.0.0.1:2883
bridge.example.proto_ver = mqttv4
bridge.example.client_id = rabbit_bridge
bridge.example.username = admin
bridge.example.password = admin
bridge.example.clean_start = true
bridge.example.keepalive = 60s
bridge.example.ssl = off
bridge.example.forwards = ttgw/#
bridge.example.max_inflight_batches = 8
I get an error in RabbitMQ:
MQTT detected framing error '"127.0.0.1:35933 -> 127.0.0.1:2883"' for connection protocol_header_corrupt
emqx logs say this:
[Client] SEND Data: {mqtt_packet,{mqtt_packet_header,1,false,0,false},{mqtt_packet_connect,<<"MQTT">>,4,true,true,false,0,false,60000,#{},<<"rabbit_bridge">>,undefined,undefined,undefined,<<"admin">>,<<"admin">>},undefined}
2019-06-27 12:13:54.064 [debug] [Client] tcp_closed
2019-06-27 12:13:54.065 [error] [Bridge Connect] Failed to connect with module=emqx_bridge_mqtt
No matter how I change the config for the bridge, the error stays the same.
How do I know/believe the problem is not on Rabbit's side ? I tried emqttc and mosquitto_pub against RabbitMQ's mqtt plugin, both work fine.
Any idea what the problem might be?
Thanks
alex
Hello, @heyoka, so sorry for so late response. This error is caused by the bridge-mode of emqx-bridge. Bridge mode is implemented by many brokers, such as emqx, mosquitto and so on. However, the mqtt plugin of the rabbitmq does not support bridge mode. I have opened a pull request to resolve this problem. Here it is: https://github.com/emqx/emqx-bridge-mqtt/pull/6
Hello @Gilbert-Wong, thank you for your answer. I suppose the bridge-mode produces non-standard headers. Maybe I look into implementing a rabbitmq mqtt_bridge plugin based on the mqtt plugin to handle such situations.
Hello,
today I tried EMQ: v3.2-rc.3 with the above config and bridge_mode = false.
It works perfectly, thank you !
Most helpful comment
Hello,
today I tried EMQ: v3.2-rc.3 with the above config and
bridge_mode = false.It works perfectly, thank you !