سؤال

I need to build a java application that will hit a certain api at say every 1 second which will send some data in response. The application will then push this data to multiple applications using some framework. I understand that this does not have to be a web app, or a web server. I am not supposed to expose an api from this server. How do I go about building this simple application?

هل كانت مفيدة؟

المحلول

Efficiency would be to use multicasting UDP as means of transport: several subscribers listen to one "stream".

http://docs.oracle.com/javase/tutorial/networking/datagrams/broadcasting.html as transport protocol to send 1 thing to several recipients.

To achieve that in an orchestrated way, a subscriber maybe first has to announce himself and receive a start time, and decryption token for that edition. Or in your case, to him a new start time and decryption token, to go reading are pushed.

For that pushing API I would look into the new emerging HTML5 support for that. As that will be mainstream. And though HTTP is not your intended protocol, it might be easier to do.

نصائح أخرى

Message.queues. Take a look at JMS Topics. Then look at a good messaging library to make using JMS easier / cleaner, like Camel, Mule, or Spring Messaging.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top