aspose file tools
The moose likes Web Services and the fly likes finding the server Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Web Services
Reply Bookmark "finding the server" Watch "finding the server" New topic
Author

finding the server

ajse ruku
Ranch Hand

Joined: May 06, 2005
Posts: 192
Hi all,
In my application there are 50 servers talking to a centrally located server.Sometimes ,the central server sends messages to the 50 servers attched to it.I want to know how should I provide the IP address and port of the 20 servers to my central server.I think mentioning the ip address and port number of 20 servers in a file is not a good solution.Please express your views.

with regards,
ajse
Peer Reynders
Bartender

Joined: Aug 19, 2005
Posts: 2906
Originally posted by ajse roy:
I think mentioning the ip address and port number of 20 servers in a file is not a good solution.Please express your views.


You haven't clarified your requirements.

If the central server only has to send messages back to the servers as part of a response to a request then the ip/domain address should become part of the request.

If the central server is broadcasting information then follow the publish/subscribe model. The client (server) would send a subscribe request to the central server that includes its ip/domain address. It could also send a unsubscribe request to be taken of the subscribers list. The central server would then send messages to all the servers that are currently on the subscribers list. The 'list' of subscribers would have to be persisted in a file or database to survive server crashes.
[ March 15, 2006: Message edited by: Peer Reynders ]

"Don't succumb to the false authority of a tool or model. There is no substitute for thinking."
Andy Hunt, Pragmatic Thinking & Learning: Refactor Your Wetware p.41
 
I agree. Here's the link: http://zeroturnaround.com/jrebel/download
 
subject: finding the server
 
Similar Threads
Dynamically building web content using XML file(s)
problem in simple chat application.
FTP Client
How to determine the port
NX: URLy Bird 1.3.1 Suncertify.properties