Using Apache ActiveMQ with C / C ++

We are writing new C / C ++ code that needs to be integrated into the ActiveMQ message bus. There are many options:

  • CMS is an easy-to-use JMS-like API for C ++.
  • OpenWire C client (available only in ActiveMQ 4.x or later).
  • OpenWire C ++ Client
  • Stomp C Client (libstomp)

Then there are the β€œwilder” parameters, such as the REST API associated with the Java ActiveMQ client using JNI, SOAP, XMPP ... So what should I use to integrate my C / C ++ application with ActiveMQ and why?

+4
source share
2 answers

Of the four clients that you list only ActiveMQ-CPP ( CMS ), it is actively supported; the rest were not active for a long time. In doing so, you should use the option that best suits your project needs. ActiveMQ-CPP allows you to use all the same functions as the JMS client, and supports broker switching, and also gives you access to some special ActiveMQ functions, such as deleting recipients, compressing messages, etc.

The requirements of your project should dictate the choice at the end.

+3
source

Yes, ActiveMQ-CPP CMS is a good option for integrating our legacy C code, but I also did c-code integration with java (JMS) as listener(Replier) using JNI and the c function from the java listener. In our case, we have a java listener that actively listens for a message from activemq broker, and then passes this message to the native c-function using JNI , and the response message from c is again sent back to activemq broker using getJMSReplyTo and getJMSCorrelationID .

we have performed both approaches, which listen to the message from the AMQ broker and pass the message to the c function and send a response / processed message to the AMK broker.

however I am interested to know below the point

  • which would be the best option and why?
  • If we go to Java and C using the JNI, then will there be a performance or concurrency problem to call the shared c library (.so library) from Java?
0
source

Source: https://habr.com/ru/post/1338798/


All Articles