View Full Version : How to communicate with local C++ app?
Sep 16th, 2004, 09:27 AM
My webapp needs to communicate with a C++ application running on the same server. SOAP will most probably be too chatty, so I was wondering what other options I have.
Sep 16th, 2004, 02:01 PM
You might see if your JMS implementation supports a C/C++ binding. I'd first though make some measurements to see if using SOAP would not meet your performance requirements.
Sep 17th, 2004, 03:00 AM
If you want something real simple, ActiveMQ has a REST API so you can perform HTTP POST / GET to send/receive messages on the JMS broker which avoids using a SOAP stack in C/C++ land.
Though SOAP is a good general solution for bridging the language divide and should be considered - but REST is a good quick solution if you need it.
Sep 17th, 2004, 04:13 AM
Thanks guys, I'll be looking into both options.
The other thing that came to mind was to have the C++ team implement a Spring-managed bean using JNI, which could communicate with their app however they like. Does that sound reasonable?
Thanks for your time,
Sep 17th, 2004, 04:23 AM
If you're considering JNI then you could always embed a JVM inside the C/C++ process and talk JNI to some Java code (be it Spring POJOs, JMS API or a SOAP stack).
e.g. it'd be fairly trivial to embed a JVM inside the C/C++ process and talk JNI to the JMS API for example.
Another option is to use GCJ to compile, say, ActiveMQ's Java code into a native C library that could be linked directly into a C/C++ application and used directly. This is my favourite & cleanest option as it can avoid much of the JNI pain.
Powered by vBulletin® Version 4.2.1 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.