0

Has anyone else seen this? The Xively server (tcp://api.xively.com:1883) accepts my connection but never responds to the MQTT CONNECT message. On a Wireshark capture I see the CONNECT message going out (with MQIdsp in the protocol field) but nothing ever comes back.

I'm using the Paho MQTT client (http://git.eclipse.org/c/paho/org.eclipse.paho.mqtt.java.git/) and unfortunately this server behaviour seems to expose a bug in the client: the connect() method in blocking mode never returns. In non-blocking mode it times out, but leaves the client in an invalid state, for example the close() method throws an exception saying that a connect is in progress. This seems to be the bug reported here: https://bugs.eclipse.org/bugs/show_bug.cgi?id=414783

I could switch to a different MQTT client but the fundamental problem is that the Xively server stops responding.

regards, Rob Maidment

RobM
  • 49
  • 6

1 Answers1

0

Are you providing an API key with the MQTT connect message as detailed in the xively site? Otherwise the connect is supposed to be rejected.

And are you send the appropriate information to the appropriate topic? The xively MQTT server doesn't just allow any kind of message but only those it specifies as acceptable to its API.

Encaitar
  • 398
  • 5
  • 16
  • Yes I'm sure I'm providing the API key. I can connect once and everything is fine, then when I disconnect and try to connect again (i.e. re-run my program) I can hit the problem but it's intermittent. I'm not sure what you mean by your second question; I'm not sending any information to any topic, or even subscribing to a topic. It's the initial CONNECT message that gets no response. This is a message that the MQTT client library sends immediately after connecting. – RobM Mar 14 '14 at 18:56
  • Ok. So the problem is intermittent. Does the first connect always work and the second one sometimes fails? Can you put that in the question so others will see it. – Encaitar Mar 14 '14 at 19:09