njh / ruby-mqtt

Pure Ruby gem that implements the MQTT protocol, a lightweight protocol for publish/subscribe messaging.
http://www.rubydoc.info/gems/mqtt
MIT License
541 stars 135 forks source link

Can't connect Apollo 1.7.1 #98

Closed vincar closed 7 years ago

vincar commented 7 years ago

Hi, when I use the latest version of ruby-mqtt,it will print

mqtt-0.5.0/lib/mqtt/packet.rb:281:in `read': Connection reset by peer (Errno::ECONNRESET)

and Apollo print

java.lang.NullPointerException at org.apache.activemq.apollo.mqtt.MqttProtocolHandler.on_mqtt_connect(MqttProtocolHandler.java:443)

njh commented 7 years ago

Hello,

I don't personally use Apache Apollo. Did it work in previous versions of ruby-mqtt?

nick.

njh commented 7 years ago

The major change in 0.5.0 is that it now defaults to MQTT v3.1.1 (the OASIS Standard published in October 2014). You can go back to the old protocol version using:

MQTT::Client.connect('test.mosquitto.org', :version => '3.1.0')

See the release notes for more changes: https://github.com/njh/ruby-mqtt/releases/tag/v0.5.0

vincar commented 7 years ago

Thank you!@njh

njh commented 7 years ago

Surprised/disappointed that there isn't a version of Apache Apollo that supports MQTT 3.1.1 - that is the only version that has been properly standardised.