简体   繁体   中英

Best way to exchange information between 2 different servers in java

I have my server side plugin, i have to send some value from my server to another server hosted on 2 different locations. 1. Server Side plugin - Hosted on some server i dont know where it is. 2. Web Application - is my application and hosted location i know.

How to exchange data from that server to my application. We have the privilege to deploy the plugins in some folder but i dont know where it is hosted. But i can use approach to send data.

Please let me know!!!

Regards, Chandan

There are many solutions to exchange data between different servers:

  • Shared database
  • Shared filesystem
  • exposure of restful web services
  • exposure of soap web services
  • rmi
  • socket connection
  • shared application that operates as a bridge between the two servers

Each solution has pro and cons. Some needs polling (shared database and filesystem for example), some others not. Some needs just an exposure of a port (web services, socket, web services) other needs additional requirements (for example a shared database needs a database and that database must be visible to both applications).

Generally if you need very fast communication with high traffic load the best solution is a socket (as for client server in databases for example). Otherwyse choose a solution more human readable and simpler to code.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM