I can connect to my VerneMQ Broker instacne using MQTT Explorer.
However My Java test written to support MQTT 5 get exception of
excep Connection lost (32109) - java.net.SocketException: Connection reset
Connection lost (32109) - java.net.SocketException: Connection reset
at org.eclipse.paho.mqttv5.client.internal.CommsReceiver.run(CommsReceiver.java:196)
at java.base/java.lang.Thread.run(Thread.java:835)
Caused by: java.net.SocketException: Connection reset
at java.base/java.net.SocketInputStream.read(SocketInputStream.java:186)
at java.base/java.net.SocketInputStream.read(SocketInputStream.java:140)
at java.base/java.io.DataInputStream.read(DataInputStream.java:149)
at org.eclipse.paho.mqttv5.client.wire.MqttInputStream.readFully(MqttInputStream.java:151)
at org.eclipse.paho.mqttv5.client.wire.MqttInputStream.readMqttWireMessage(MqttInputStream.java:124)
at org.eclipse.paho.mqttv5.client.internal.CommsReceiver.run(CommsReceiver.java:139)
I set -e “LISTENER_TCP_ALLOWED_PROTOCOL_VERSIONS=3,4,5” the enable support for MQTT ver 3.x and 5.x
I am able to connect use MQTT Explorer, my Java client MQTT support ver 3.x can publish to subcribe to VerneMQ docker contains is running.
But my Java client MQTT support ver 5.x can NOT publish to subcribe I get an error of
cause java.net.SocketException: Connection reset
excep Connection lost (32109) - java.net.SocketException: Connection reset
Connection lost (32109) - java.net.SocketException: Connection reset
at org.eclipse.paho.mqttv5.client.internal.CommsReceiver.run(CommsReceiver.java:196)
at java.base/java.lang.Thread.run(Thread.java:835)
How can check my version VerneMQ docker container is enable to support MQTT ver 5.x
My main of objectivw to use Request and Repsone message that support in MQTT ver 5.x.
Note: my Java client MQTT support ver 5.x can publish to subcribe fine with Mosquito or HiveMQTT, we want would to use VerneMQ in QA, pre-prod and production environment.
Interesting.
First, check what the Verne logs say on that connection attempt.
Second, can you try setting the allowed protocols on a listener level, not on protocol (TCP) level?
That is, you should end up with a line like listener.tcp.my_listener.allowed_protocol_versions=3,4,5 in the vernemq.conf file, where my_listener is the name of your listener. (Use the same name as in the listener endpoint definition. It is named default by default.)
Connection lost (32109) - java.net.SocketException: Connection reset
at org.eclipse.paho.mqttv5.client.internal.CommsReceiver.run(CommsReceiver.java:196)
at java.base/java.lang.Thread.run(Thread.java:835)
Caused by: java.net.SocketException: Connection reset
at java.base/java.net.SocketInputStream.read(SocketInputStream.java:186)
at java.base/java.net.SocketInputStream.read(SocketInputStream.java:140)
at java.base/java.io.DataInputStream.read(DataInputStream.java:149)
my Java client MQTT support ver 5.x but my Java client MQTT support ver 3.x working fine.
Also I can not see VerneMQ log file from /var/log/vernemq/console.log
Or in the directories I specific -e “LOG_CONSOLE_FILE=/opt/scats/log/vernemq.log” -e “LOG_ERROR_FILE=/opt/scats/log/vernemq_error.log”
I am kind of block
Can please let me know what I am doing wrong.
Exec into the container, then check with cat etc/vernemq.conf. Doing this should show you the last lines of the conf file. All the values between ###START### and ###END### will be the inserted ones. This way you can make sure you got the format right. All the values should have the same format as in a canonical vernemq.conf file.
EDIT: (to be explicit)
prefix any env var with DOCKER_VERNEMQ_
replace any . in the canonical format with __ (2 underscores)
but don’t substitute any _ that is part of the variable name, as in ALLOW_ANONYMOUS
Thank you very for your help, I finally got my VerneMQ Docker container accept request from my Java Client MQTT 5.x and 3.x, by putting -e “DOCKER_VERNEMQ_LISTENER__TCP__ALLOWED_PROTOCOL_VERSIONS=3,4,5”