Question: Java program for single client, single broker, multiple servers Client request for a service and asks the broker about the service provider if the broker
Java program for single client, single broker, multiple servers
Client request for a service and asks the broker about the service provider if the broker has the provider that gives that service then it should tell the client about that server to the client
Then that server and client should connect
for example client asks the broker for service no 1 broker will check whether there is any server that provides service no 1 and tell the port number of the server to the client.
Then client using that port number connects with that server. Then that particular server should connect with the client and tell them service 1 is done. If the broker doesnt have any details about the server that provides service 1 then it should return a message to the client that it doesnt have any server that provides service 1 .
So for this lets have 3 servers first server will have services 1 to 10 second server will have 11 to 20 services third will have 21 to 30 services.
If client asks broker about service 11 then it should give the details of second server to the client like port number and IP address to the client and then client using that port number can connect to that particular second server and server can reply client that service 11 is done IP address can be same for all the programs. If the client asks broker for service 31 then broker should return the message to the client that there is no server that provides service 31.
*** There should be three programs one for client one for broker one for server .
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
