New version!A new version of this website is available at architectural-patterns.net. Broker / Service Oriented Architecture
You just want the job to be done. You don't care who performs it, but you may have some demands. Tell your broker. He will take care of it. Examples
Where does it come from?You go to a broker to buy a house. You don't want to need to know all about the housing business, costs, quality, suppliers. You just tell the broker your maximum price and some other requirements, and he starts looking. When should you use it?
How does it work?At all times servers can register and deregister themselves with the broker. If a server fails, it will be automatically (after a timeout) unregistered by the broker. The client requests a specific service. It formats its request in a specific format and sends it to its broker. The broker then selects the most suitable server to process the request. When the link between the client and the server is set up, they may start communicating directly, freeing the broker. Picture: Broker Architecture There may also be multiple brokers in an architecture. These will then need their own communication protocols. ProblemsOnce you set up the broker, it is easy to program the service calls. Take care to handle transactions and exceptions well, though. Common implementations
Links |