maydemirx / moquette-mqtt

Automatically exported from code.google.com/p/moquette-mqtt
Apache License 2.0
0 stars 1 forks source link

Disruptor FatalExceptionHandler when calling from a javascript Paho client #14

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. stated with
   java -jar moquette-broker-0.3-jar-with-dependencies.jar

2. tried to connect to broker with Paho javascript client

https://www.ibm.com/developerworks/community/blogs/c565c720-fe84-4f63-873f-607d8
7787327/entry/how_to_prog_javascript?lang=en#tc60302___messbasics
(with mqttws31.js taken from 
http://git.eclipse.org/c/paho/org.eclipse.paho.mqtt.javascript.git/tree/src/mqtt
ws31.js)

What is the expected output? What do you see instead?

The broker shows this error:

Starting server with netty connectors
ott 23, 2013 12:19:38 PM com.lmax.disruptor.FatalExceptionHandler 
handleEventException
SEVERE: Exception processing: 2 
org.dna.mqtt.moquette.messaging.spi.impl.ValueEvent@10e3816
java.lang.NullPointerException
        at org.dna.mqtt.moquette.messaging.spi.impl.ProtocolProcessor.processPubRec(ProtocolProcessor.java:331)
        at org.dna.mqtt.moquette.messaging.spi.impl.SimpleMessaging.onEvent(SimpleMessaging.java:148)
        at org.dna.mqtt.moquette.messaging.spi.impl.SimpleMessaging.onEvent(SimpleMessaging.java:32)
        at com.lmax.disruptor.BatchEventProcessor.run(BatchEventProcessor.java:113)
        at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
        at java.util.concurrent.FutureTask.run(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)

What version of the product are you using? On what operating system?
- version 0.3
- Windows 7 32bit

Original issue reported on code.google.com by vincenzo...@gmail.com on 23 Oct 2013 at 10:27

GoogleCodeExporter commented 8 years ago

Original comment by selva.an...@gmail.com on 24 Oct 2013 at 9:45

GoogleCodeExporter commented 8 years ago
The mqttws javascript library use WebSocket as a carrier protocol for MQTT 
frames, moquette is an MQTT broker that doesn't support WebSocket, before use 
this you have to put a proxy between WebSocket+MQTT and plain MQTT.

Original comment by selva.an...@gmail.com on 24 Oct 2013 at 10:15

GoogleCodeExporter commented 8 years ago
I don't need to use mqttws necessarily, it was just my first trial.
I just need to call moquette from javascript; so what plain MQTT javascript 
library could I use?
Do you have any html/javascript example or test page that should I look at?
Thank you very much
Vincenzo

Original comment by vincenzo...@gmail.com on 24 Oct 2013 at 9:26

GoogleCodeExporter commented 8 years ago
I don't have any experience with MQTT javascript library, I've used Eclipse 
Paho Java client library, but from the mqtt.org 
(http://mqtt.org/wiki/doku.php/libraries) there are some js lib that don't use 
WebSocket, https://github.com/adamvr/MQTT.js and 
https://github.com/mcollina/ascoltatori as I understand both runs into Node.js. 
I expect that from a browser you can't open a JS connection to port different 
from HTTP ports, but it's just mine hypotesis.

 Regards

   Andrea

Original comment by selva.an...@gmail.com on 28 Oct 2013 at 10:14