bentzy bentzy - 11 months ago 68
Android Question

MQTT Android not connecting to ActiveMq

I'm trying to connect an Android application to an ActiveMQ server.
I'm using ActiveMQ because my server already talks to the ActiveMQ server using JMS so it will be very beneficial for me to connect the android client to the JMS broker.

I've enabled MQTT in ActiveMQ following this page:
and I had a small problem with any of the MQTT clients (IBM MQTT client or Paho MQTT Client) I've downloaded didn't recognize "mqtt://" url prefix so I tried to use tcp instead. This is how the configuration looks like in activemq.xml:

<transportConnector name="openwire" uri="tcp://;wireformat.maxFrameSize=104857600"/>
<transportConnector name="amqp" uri="amqp://;wireformat.maxFrameSize=104857600"/>
<transportConnector name="mqtt" uri="tcp://"/>

When I try to connect using any mqtt client example such as this one: I'm unable to connect to the ActiveMQ and I get an error on the server side:

2013-09-05 12:34:17,550 | WARN | Transport Connection to: tcp:// failed: Unknown data type: 77 | | ActiveMQ Transport: tcp:///

Any suggestions?


You haven't configured the MQTT transportConnector properly. Try this:

  <transportConnector name="mqtt" uri="mqtt://localhost:1883"/>

Notice that in yours you used the TCP uri prefix.