activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aragoubi <>
Subject Can't connect to broker from paho mqtt client
Date Thu, 11 May 2017 08:59:40 GMT

I have an embedded activeMQ broker listening to two ports.
Here's my broker-config file : 

<?xml version="1.0" encoding="UTF-8"?>

  <broker xmlns="" useJmx="true"
useShutdownHook="false"  brokerName="mimo.broker1">

       <managementContext createConnector="false"/>
				<memoryUsage limit="64 mb"/>
				<storeUsage limit="100 gb"/>
				<tempUsage limit="50 gb"/>

       <kahaDB directory="activemq-data/kahadb"/>

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

When I launch my jboss server I see that the broker is launched and
listening to ports:

11:00:33,792 INFO 
[org.apache.activemq.transport.TransportServerThreadSupport] (Starting
ActiveMQ Broker) Listening for connections at: tcp://DESKTOP-4D80FU1:61616
11:00:33,793 INFO  [] (Starting
ActiveMQ Broker) Connector mimo.broker1 started
11:00:33,849 INFO  [org.eclipse.jetty.server.Server] (Starting ActiveMQ
Broker) jetty-7.6.9.v20130131
11:00:33,876 INFO  [org.eclipse.jetty.server.handler.ContextHandler]
(Starting ActiveMQ Broker) started o.e.j.s.ServletContextHandler{/,null}
11:00:33,905 INFO  [org.eclipse.jetty.server.AbstractConnector] (Starting
ActiveMQ Broker) Started SelectChannelConnector@
11:00:33,906 INFO  []
(Starting ActiveMQ Broker) Listening for connections at
11:00:33,907 INFO  [] (Starting
ActiveMQ Broker) Connector mqtt+ws started
11:00:33,908 INFO  [] (Starting
ActiveMQ Broker) Apache ActiveMQ 5.9.0 (mimo.broker1,
ID:DESKTOP-4D80FU1-57645-1494493233653-0:1) started
11:00:33,909 INFO  [] (Starting
ActiveMQ Broker) For help or more information please see:

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

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

My problem is that the connection is never getting established with the
Either I am getting this error
(qtp749972657-157) Transport Connection to: MQTTSocket_2052272783 failed: Invalid CONNECT encoding".

Anyone know how to resolve this problem? Is this an activeMQ configuration

View this message in context:
Sent from the ActiveMQ - User mailing list archive at

View raw message