Monday, June 3, 2024
 Popular · Latest · Hot · Upcoming
3
rated 0 times [  10] [ 7]  / answers: 1 / hits: 16116  / 7 Years ago, tue, may 9, 2017, 12:00:00

Background



I am studying ApacheMQ for a project where we need a message broker. Upon reading the official page I see some features that I am interested in:





However, following the documentation, it is not clear to me if some of my objectives are possible.



Questions



I understand that in order to use ActiveMQ as a broker, I first need a messaging protocol. According to the documentation on language support for Node.js ActiveMQ only supports the STOMP protocol for Node.js.




  1. Given that STOMP is a protocol, if I find a NPM library for any of the other protocols, can I use Node.js with that given protocol?

  2. If such libraries exist, can you point some?

  3. Are there any caveats in using Node.js and ActiveMQ with another protocol other than STOMP?



Regarding EIPs, I also need some clarification. After closer checking, I realized that EIPs can only be used via Apache Camel, a separate project with no support for anything other than Java.




  1. Is it possible to use any of the EIPs that ActiveMQ offers with Node.js? If so, how?


More From » node.js

 Answers
33

Disclaimer



It has been some time since I posted this, and for future reference I am posting my findings here. These findings relate my experience and as of the date of this post they are as accurate as possible.



Answers



Q1: Given that STOMP is a protocol, if I find a NPM library for any of the other protocols, can I use Node.js with that given protocol?



A1: The answer is yes. For example, using a MQTT library for Node.js, I can communicate with the ActiveMQ broker. There are usually some quirks that one has to considerate, but it definitely works.






Q2: If such libraries exist, can you point some?



A2:





Personally I would like to at least see the MQTT library added to the official documentation, as I believe it would help clear many questions from users.






Q3: Are there any caveats in using Node.js and ActiveMQ with another protocol other than STOMP?



A3: Yes. ActiveMQ has weird authentication requirements which lead to clients using a protocol's supported version to fail on connect (an example is with the previous AMQP 1.0 npm library). Furthermore, each library has its quirks, that you need to check. Usually the library's github page or issues page will give you some light on the integration issues with ActiveMQ, but it helps if the creators state clear support for ActiveMQ (which is not always the case).






Q4: Is it possible to use any of the EIPs that ActiveMQ offers with Node.js? If so, how?



A4: I believe this would still be possible via the REST DSL with XML (even though we don't use Spring nor anything like that) but I can't find anything nor anyone actually using it. The community failed to provide any feedback regarding this matter, as it seems to be very dependent on Java technologies, without knowledge in other other field.



Conclusion



Overall, if you have a Java project, you would be fine using ActiveMQ. If you want to use anything else, I strongly recommend avoiding it.



Everything either needs Java or some level of integration with it.



You could argue that ActiveMQ supports a large variety of protocols, but so do other tools that actually have support for your own language.



Even in the end, the EIPs provided by Camel, are not really available for for anything other than Java and even the community suggests you implement the patterns yourself, which defeats the whole purpose of using ActiveMQ.



Sources



Community thread: http://activemq.2283324.n4.nabble.com/Integration-between-Node-js-and-ActiveMQ-how-to-use-td4725822.html



Specials thanks to Gordon Sim-2 the author of rhea. Cool project, go check it out !


[#57844] Saturday, May 6, 2017, 7 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
charity

Total Points: 503
Total Questions: 98
Total Answers: 125

Location: Mali
Member since Fri, Dec 3, 2021
3 Years ago
;