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.
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.
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.
As mentioned by Flame_Phoenix, you can easily use HTTP protocol to publish and receive messages
For more information: https://activemq.apache.org/rest
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.
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.
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.
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 !
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With