2

I am working on a platform to monitor and control devices which use MQTT for the communication layer. I use REST endpoints for the Angular2 based SPA Web. The backend is developed in JEE using WildFly which support out of the box the MQTT protocol through is JMS Broker(Active MQ).

I am new in JEE and don’t know a lot of things:
- I have never used the JMS System
- I can’t find any information o tutorial to point me in the right way to get MQTT messages through a JMS Application.

Can you help me to build a very basic App on WildWfly which demonstrates how to consume/produce JMS Messages through MQTT?

EDIT

Based on this post (you should add manually support for other message protocol to WildFly), I tried to add MQTT support adding a mqtt module to WildFly folder on this way:

\wildfly-10.1.0.Final\modules\system\layers\base\org\apache\activemq\artemis\protocol\mqtt\main\module.xml:

<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.3" name="org.apache.activemq.artemis.protocol.mqtt">
    <resources>
        <resource-root path="artemis-mqtt-protocol-1.3.0.jar"/>
        <resource-root path="netty-codec-mqtt-4.1.5.Final"/>
    </resources>

    <dependencies>
        <!-- required to load ActiveMQ protocol SPI -->
        <module name="org.apache.activemq.artemis"/>
    </dependencies>
</module>

I also added the resource jars to the folder.

\wildfly-10.1.0.Final\modules\system\layers\base\org\apache\activemq\artemis\main\module.xml:

<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.3" name="org.apache.activemq.artemis">
    ....
    <dependencies>
        ...
        <module name="org.apache.activemq.artemis.protocol.mqtt" services="import" optional="true"/>
        ...
    </dependencies>
</module>

But when a run WildFly, I cant see on the output

Adding protocol support for: MQTT

WildFly output

  • Expecting people to do things from scratch on Stack Overflow rarely gets anywhere, by contrast if you show what you've tried already people will help you fix it and make it work. Update the question with what you've actually tried. – hardillb Sep 10 '16 at 16:43
  • Any solutions on this? I'm trying to use eclipse paho library inside a EJB. Is it possible? I'm having issues importing eclipse paho .jar library in my EJB and use it :s – Twimnox Dec 29 '16 at 15:16
  • @Twimnox is posible, currently i am using this implementation: [link](https://gist.github.com/atc91/d7befd58e71ddc9a01abc37fad905681) – Christian Amú Trujillo Dec 30 '16 at 19:31
  • @atc91 what are your server configuration settings? I can deploy and access the library, but when I invoke objects from MQTT paho library, they are instantiated as "null", hence crashing the deployment. – Twimnox Jan 04 '17 at 12:04
  • @Twimnox I am using standard "full-standalone.xml" file. I think the server has not access to the pao library. You should include the pao jar file into you deploy file(.ear .war) or add the library to the server installation folder ("...wildfly-10.1.0.Final\standalone\lib") – Christian Amú Trujillo Jan 04 '17 at 21:28
  • Did you find a solution for this ? I am facing the same problem ... – Aymen Ragoubi Jul 31 '17 at 11:59
  • @AymenRagoubi currently i'm using a singleton bean [link](https://gist.github.com/atc91/d7befd58e71ddc9a01abc37fad905681) – Christian Amú Trujillo Aug 02 '17 at 15:51

0 Answers0