tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Abhishek <akvk....@gmail.com>
Subject Re: How to enable MQTT in TomEE ?
Date Wed, 09 Nov 2016 17:13:09 GMT
hasalex wrote
> It works !
> 
> I've added this piece of configuration in the tomee.xml file :
> 
>     
> <Resource id="MqttResourceAdapter" type="ActiveMQResourceAdapter">
>         BrokerXmlConfig =  broker:(mqtt://localhost:1883)
>     
> </Resource>
> 	
> 
> Then I've added mqtt-client-1.6.jar and activemq-mqtt-5.9.0.jar files into
> TomEE's lib directory.

Hi,

I am trying to enable MQTT in Apache TomEE 7.0.1. I have updated tomee.xml
with below contents
  <Resource id="MQTTResourceAdapter" type="ActiveMQResourceAdapter">
      BrokerXmlConfig =
broker:(mqtt://localhost:1883)?useJmx=false&amp;persistent=false    
  </Resource>

I also added the activemq-mqtt-5.13.3.jar and other dependencies to
tomee/lib

But when I run my Maven project on TomEE (Windows 10) following message is
displayed

/WARNING - Exception occurred processing: 
MQTTFrame { type: unknown, qos: AT_MOST_ONCE, dup:false }:
org.apache.activemq.transport.mqtt.MQTTProtocolException: Unknown MQTTFrame
type: 0/

In the code when I try to create the connection then exception is thrown.

Code:
/ConnectionFactory factory = new
ActiveMQConnectionFactory("tcp://localhost:1883");
Connection connection = factory.createConnection();
connection.start();/

Exception:
*javax.jms.JMSException: Cannot send, channel has already failed:
tcp://127.0.0.1:1883*
	at
org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java:72)
	at
org.apache.activemq.ActiveMQConnection.syncSendPacket(ActiveMQConnection.java:1407)
	at
org.apache.activemq.ActiveMQConnection.ensureConnectionInfoSent(ActiveMQConnection.java:1496)
	at
org.apache.activemq.ActiveMQConnection.start(ActiveMQConnection.java:523)


Since there was a thread on this topic I posted here. If required I will
start a new thread.

Thanks,
Abhishek






--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/How-to-enable-MQTT-in-TomEE-tp4666817p4680509.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Mime
View raw message