Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

IPC between Java (JSP/tomcat) frontend and background services

807589Jan 19 2009 — edited Jan 19 2009
Hi

I am currently writing a background processing application (pure IO processing) in the C language (mostly because of code reuse). The code mostly reads a file, do some processing/analysis, and write some results to a file (later perhaps it will read/write to a database). The service is pretty much done, however, I want to be able to manage it with a web-frontend.

So I have the background service which in its current state will, upon execution, read a file, process it and save the result. Now I am looking into using Java as frontend for this and need some sort of IPC mechanism for controlling it from java. What I want to achieve is to have a website where I can see whether its currently processing or not, progress, and be able to start/pause/stop it if I wish to do so. The web front-end is pretty much designed and ready, except for the actual connection between the front-end and backend.

After a discussion with a couple of people multiple suggestions were presented: one was to use a local UDP socket, however I feel this perhaps is a workaround for the original purpose, involving having to deal with firewalls, networking protocols, etc... Another suggestion was to use the windows message queue mechanism in the service and some JNI magic in order to push messages into it..a third was to use a unix pipe (which in turn involves tying the app to a UNIX-based OS) and some more JNI magic.

However, I am looking for the optimal solutions for IPC between a frontend and backend in Java instead of having to deal with workarounds and JNI if possible. As you can see, I have put some thought into this so I am not throwing problems at others to fix for me. I am really hoping that, since I am unfamiliar with the Java IPC capabilities, that I for the learning purposes used "best practice" to begin with. I would really appreciate any reflections or suggestions around this topic.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 16 2009
Added on Jan 19 2009
5 comments
445 views