Quantcast

[org.apache.activemq.broker.TransportConnection.Transport] (qtp749972657-157) Transport Connection to: MQTTSocket_2052272783 failed: java.io.IOException: Invalid CONNECT encoding

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[org.apache.activemq.broker.TransportConnection.Transport] (qtp749972657-157) Transport Connection to: MQTTSocket_2052272783 failed: java.io.IOException: Invalid CONNECT encoding

aragoubi
I integrated activeMQ broker into my jboss in such a way that the broker is launched when jboss launch.
This is transport connectors defined in my broker's config file:

    <transportConnectors>
      <transportConnector name="mimo.broker1" uri="tcp://0.0.0.0:61616" />
          <transportConnector name="mqtt+ws" uri="ws://0.0.0.0:1883"/>         
    </transportConnectors>

I tried a mqtt client using java paho mqttv3, this is how I tried to connect to my broker:

        String broker = "ws://127.0.0.1:1883";
        String clientId = "JavaSample";
        MemoryPersistence persistence = new MemoryPersistence();
        try
                {
                        MqttAsyncClient sampleClient = new MqttAsyncClient(broker, clientId, persistence);
                        MqttConnectOptions connOpts = new MqttConnectOptions();
                        connOpts.setCleanSession(true);
                        connOpts.setAutomaticReconnect(true);
                        IMqttToken token = sampleClient.connect(connOpts);
                }catch(MqttException e){
                          e.printStackTrace();
                }

I think that the problem came from the port defined into the broker, because when I tried to connect to mosquito broker "tcp://test.mosquitto.org:1883" it works.
I tried also to change 0.0.0.0 by localhost or by 127.0.0.1 by I am getting the same problem.

Could someone help me with this ?


Loading...