문제

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