tags:

views:

191

answers:

4

My app is a feed aggregator. The frontend is programmed in php, but I have a Java program running periodically to update the feeds database. Under the current scheme if a user adds a feed to be aggregated he must have to wait until the aggregator runs and updates the database to see the news from the feed he subscribed. What I want to do is to securely send a message from the php script to the aggregator issuing an exceptional feed update.

+1  A: 

Open a server socket in Java application. Then send the data over it. You may use SSL to secure the communication.

Socket Communication in PHP

Socket Communication in Java

Chathuranga Chandrasekara
A: 

Would having the java app waiting for commands on a socket be an acceptable option?

Fredrik
+1  A: 

If the java program is on the PHP server can't you just simply open a shell from php to run the java program with arguments to trigger the update ?

Sébastien Nussbaumer
I expressed the idea incorrectly. The Java program is always running, only the update threads are running periodically.
Pedro Henriques
+2  A: 

You can use some well-established language agnostic remote communications protocols like SOAP or REST (both supported by java and php) or develop you own socket based solution.

Additional option might be php-java bridge which promises to be performance wise effective.

Gennady Shumakher