javapushserver-communication

Java server-to-server interface


I have to design a (java) interface for server-to-server communication, but I have no experience what so ever in this field.

My Server fetches information from different sources. Other servers shall be able to connect to the server and get the current information as well as receive changes via push notifications. The interface should not depend on certain programming languages or operating systems for those other servers. My first thought was to use sockets and leave the socket open to transmit changes. Is there a better way to this?


Solution

  • I guess working in a Java EE environment the easiest would be using web services. But if this is not the case and/or you need pushing, I would recommend using some library. For example xSocket that uses non-blocking IO sockets and can send and receive any string messages asynchronously. From there on you can use for example JAXB binders to send XML messages or any other format.