Quantcast

WARN [org.apache.activemq.broker.TransportConnection.Transport] (qtp906254668-147) Transport Connection to: MQTTSocket_248153872 failed: java.io.IOException: Invalid CONNECT encoding

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

WARN [org.apache.activemq.broker.TransportConnection.Transport] (qtp906254668-147) Transport Connection to: MQTTSocket_248153872 failed: java.io.IOException: Invalid CONNECT encoding

aragoubi
I have an embedded activeMQ broker listening to two ports.

Here's my broker-config file :

<?xml version="1.0" encoding="UTF-8"?>
<beans
  xmlns="http://www.springframework.org/schema/beans"
  xmlns:amq="http://activemq.apache.org/schema/core"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
  http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd">

 
  <broker xmlns="http://activemq.apache.org/schema/core" useJmx="true" useShutdownHook="false"  brokerName="mimo.broker1">

     <managementContext>     
       <managementContext createConnector="false"/>
     </managementContext>         
         <systemUsage>
                <systemUsage>
                        <memoryUsage>
                                <memoryUsage limit="64 mb"/>
                        </memoryUsage>
                        <storeUsage>
                                <storeUsage limit="100 gb"/>
                        </storeUsage>
                        <tempUsage>
                                <tempUsage limit="50 gb"/>
                        </tempUsage>
                </systemUsage>
        </systemUsage>
    <persistenceAdapter>
       <kahaDB directory="activemq-data/kahadb"/>
     </persistenceAdapter>
    <transportConnectors>
      <transportConnector name="mimo.broker1" uri="tcp://0.0.0.0:61616" />
          <transportConnector name="mqtt+ws" uri="ws://0.0.0.0:1884"/>         
    </transportConnectors>
   
  </broker>
</beans>

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  [org.apache.activemq.broker.TransportConnector] (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@0.0.0.0:1884
11:00:33,906 INFO  [org.apache.activemq.transport.ws.WSTransportServer] (Starting ActiveMQ Broker) Listening for connections at ws://DESKTOP-4D80FU1:1884
11:00:33,907 INFO  [org.apache.activemq.broker.TransportConnector] (Starting ActiveMQ Broker) Connector mqtt+ws started
11:00:33,908 INFO  [org.apache.activemq.broker.BrokerService] (Starting ActiveMQ Broker) Apache ActiveMQ 5.9.0 (mimo.broker1, ID:DESKTOP-4D80FU1-57645-1494493233653-0:1) started
11:00:33,909 INFO  [org.apache.activemq.broker.BrokerService] (Starting ActiveMQ Broker) For help or more information please see: http://activemq.apache.org

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();
                }

My problem is that the connection is never getting established with the broker.
I am getting this warn when I try to connect to broker "[WARN  [org.apache.activemq.broker.TransportConnection.Transport] (qtp906254668-147) Transport Connection to: MQTTSocket_248153872 failed: java.io.IOException: Invalid CONNECT encoding".

I tried to connect to mosquitto remote broker "tcp://test.mosquitto.org:1883" and it works.
Could someone help me with this? Is this an activeMQ configuration problem?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: WARN [org.apache.activemq.broker.TransportConnection.Transport] (qtp906254668-147) Transport Connection to: MQTTSocket_248153872 failed: java.io.IOException: Invalid CONNECT encoding

Tim Bain
This is the third thread you've started in the past two days asking the
same question. Please don't create duplicate threads.

On May 11, 2017 6:54 AM, "aragoubi" <[hidden email]> wrote:

> I have an embedded activeMQ broker listening to two ports.
>
> Here's my broker-config file :
>
> <?xml version="1.0" encoding="UTF-8"?>
> <beans
>   xmlns="http://www.springframework.org/schema/beans"
>   xmlns:amq="http://activemq.apache.org/schema/core"
>   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>   xsi:schemaLocation="http://www.springframework.org/schema/beans
> http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
>   http://activemq.apache.org/schema/core
> http://activemq.apache.org/schema/core/activemq-core.xsd">
>
>
>   <broker xmlns="http://activemq.apache.org/schema/core" useJmx="true"
> useShutdownHook="false"  brokerName="mimo.broker1">
>
>      <managementContext>
>        <managementContext createConnector="false"/>
>      </managementContext>
>          <systemUsage>
>                 <systemUsage>
>                         <memoryUsage>
>                                 <memoryUsage limit="64 mb"/>
>                         </memoryUsage>
>                         <storeUsage>
>                                 <storeUsage limit="100 gb"/>
>                         </storeUsage>
>                         <tempUsage>
>                                 <tempUsage limit="50 gb"/>
>                         </tempUsage>
>                 </systemUsage>
>         </systemUsage>
>     <persistenceAdapter>
>        <kahaDB directory="activemq-data/kahadb"/>
>      </persistenceAdapter>
>     <transportConnectors>
>       <transportConnector name="mimo.broker1" uri="tcp://0.0.0.0:61616" />
>           <transportConnector name="mqtt+ws" uri="ws://0.0.0.0:1884"/>
>     </transportConnectors>
>
>   </broker>
> </beans>
>
> 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  [org.apache.activemq.broker.TransportConnector]
> (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@0.0.0.0:1884
> 11:00:33,906 INFO  [org.apache.activemq.transport.ws.WSTransportServer]
> (Starting ActiveMQ Broker) Listening for connections at
> ws://DESKTOP-4D80FU1:1884
> 11:00:33,907 INFO  [org.apache.activemq.broker.TransportConnector]
> (Starting
> ActiveMQ Broker) Connector mqtt+ws started
> 11:00:33,908 INFO  [org.apache.activemq.broker.BrokerService] (Starting
> ActiveMQ Broker) Apache ActiveMQ 5.9.0 (mimo.broker1,
> ID:DESKTOP-4D80FU1-57645-1494493233653-0:1) started
> 11:00:33,909 INFO  [org.apache.activemq.broker.BrokerService] (Starting
> ActiveMQ Broker) For help or more information please see:
> http://activemq.apache.org
>
> 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();
>                 }
>
> My problem is that the connection is never getting established with the
> broker.
> I am getting this warn when I try to connect to broker "[WARN
> [org.apache.activemq.broker.TransportConnection.Transport]
> (qtp906254668-147) Transport Connection to: MQTTSocket_248153872 failed:
> java.io.IOException: Invalid CONNECT encoding".
>
> I tried to connect to mosquitto remote broker
> "tcp://test.mosquitto.org:1883" and it works.
> Could someone help me with this? Is this an activeMQ configuration problem?
>
>
>
> --
> View this message in context: http://activemq.2283324.n4.
> nabble.com/WARN-org-apache-activemq-broker-TransportConnection-Transport-
> qtp906254668-147-Transport-Connection-g-tp4725962.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: WARN [org.apache.activemq.broker.TransportConnection.Transport] (qtp906254668-147) Transport Connection to: MQTTSocket_248153872 failed: java.io.IOException: Invalid CONNECT encoding

Tim Bain
In reply to this post by aragoubi
In
http://stackoverflow.com/questions/33508706/activemq-protocolexception-invalid-connect-encoding,
Tim Bish mentioned a couple of possible things that could result in this
error (though the possibilities were all very generic, so I'd be surprised
if they led you to the answer on their own), and he also gave a suggestion
for a Log4J configuration change that might provide additional information.

If the Log4J change doesn't provide anything useful, you could attach a
debugger to the broker, set a breakpoint at the log line you quoted (or at
appropriate points upstream from it), and step through the code to see what
it is about the content your client is sending that the broker doesn't
like. If it was me, I'd just skip right to this option rather than messing
with the Log4J config, but the choice is yours.

Tim

On May 11, 2017 6:54 AM, "aragoubi" <[hidden email]> wrote:

> I have an embedded activeMQ broker listening to two ports.
>
> Here's my broker-config file :
>
> <?xml version="1.0" encoding="UTF-8"?>
> <beans
>   xmlns="http://www.springframework.org/schema/beans"
>   xmlns:amq="http://activemq.apache.org/schema/core"
>   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>   xsi:schemaLocation="http://www.springframework.org/schema/beans
> http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
>   http://activemq.apache.org/schema/core
> http://activemq.apache.org/schema/core/activemq-core.xsd">
>
>
>   <broker xmlns="http://activemq.apache.org/schema/core" useJmx="true"
> useShutdownHook="false"  brokerName="mimo.broker1">
>
>      <managementContext>
>        <managementContext createConnector="false"/>
>      </managementContext>
>          <systemUsage>
>                 <systemUsage>
>                         <memoryUsage>
>                                 <memoryUsage limit="64 mb"/>
>                         </memoryUsage>
>                         <storeUsage>
>                                 <storeUsage limit="100 gb"/>
>                         </storeUsage>
>                         <tempUsage>
>                                 <tempUsage limit="50 gb"/>
>                         </tempUsage>
>                 </systemUsage>
>         </systemUsage>
>     <persistenceAdapter>
>        <kahaDB directory="activemq-data/kahadb"/>
>      </persistenceAdapter>
>     <transportConnectors>
>       <transportConnector name="mimo.broker1" uri="tcp://0.0.0.0:61616" />
>           <transportConnector name="mqtt+ws" uri="ws://0.0.0.0:1884"/>
>     </transportConnectors>
>
>   </broker>
> </beans>
>
> 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  [org.apache.activemq.broker.TransportConnector]
> (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@0.0.0.0:1884
> 11:00:33,906 INFO  [org.apache.activemq.transport.ws.WSTransportServer]
> (Starting ActiveMQ Broker) Listening for connections at
> ws://DESKTOP-4D80FU1:1884
> 11:00:33,907 INFO  [org.apache.activemq.broker.TransportConnector]
> (Starting
> ActiveMQ Broker) Connector mqtt+ws started
> 11:00:33,908 INFO  [org.apache.activemq.broker.BrokerService] (Starting
> ActiveMQ Broker) Apache ActiveMQ 5.9.0 (mimo.broker1,
> ID:DESKTOP-4D80FU1-57645-1494493233653-0:1) started
> 11:00:33,909 INFO  [org.apache.activemq.broker.BrokerService] (Starting
> ActiveMQ Broker) For help or more information please see:
> http://activemq.apache.org
>
> 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();
>                 }
>
> My problem is that the connection is never getting established with the
> broker.
> I am getting this warn when I try to connect to broker "[WARN
> [org.apache.activemq.broker.TransportConnection.Transport]
> (qtp906254668-147) Transport Connection to: MQTTSocket_248153872 failed:
> java.io.IOException: Invalid CONNECT encoding".
>
> I tried to connect to mosquitto remote broker
> "tcp://test.mosquitto.org:1883" and it works.
> Could someone help me with this? Is this an activeMQ configuration problem?
>
>
>
> --
> View this message in context: http://activemq.2283324.n4.
> nabble.com/WARN-org-apache-activemq-broker-TransportConnection-Transport-
> qtp906254668-147-Transport-Connection-g-tp4725962.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: WARN [org.apache.activemq.broker.TransportConnection.Transport] (qtp906254668-147) Transport Connection to: MQTTSocket_248153872 failed: java.io.IOException: Invalid CONNECT encoding

aragoubi
In reply to this post by Tim Bain
Ok understood.
I have a A doubt that the warn is comming from the fact that I am connecting a MQTT client over websocket.
I don't know if activeMQ allows mqtt+ws.
I tried to connect to the port "ws://0.0.0.0:1884" from a mqtt client(apache paho java).
Do you have an idea how to enable mqtt over websocket with activeMQ ?

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: WARN [org.apache.activemq.broker.TransportConnection.Transport] (qtp906254668-147) Transport Connection to: MQTTSocket_248153872 failed: java.io.IOException: Invalid CONNECT encoding

aragoubi
This post was updated on .
In reply to this post by Tim Bain
When I changed ws://0.0.0.0:1884 by mqtt://0.0.0.0:1884 I am getting this problem

11:19:16,308 WARN  [org.apache.activemq.transport.mqtt.MQTTProtocolConverter] (ActiveMQ Transport: tcp:///192.168.0.116:59362@1884) Exception occurred processing:
MQTTFrame { type: CONNACK, qos: AT_MOST_ONCE, dup:false }: org.apache.activemq.transport.mqtt.MQTTProtocolException: Unknown MQTTFrame type: 2

Do you have an idea why I am getting this problem ?
Is it possible to user mqtt over websocket in activeMQ ?
Loading...