This section explains, through an example scenario, how the Message Dispatcher EIP can be implemented using WSO2 ESB. The following topics are covered:
Table of Contents |
---|
...
Figure 2: Example Scenario of the Message Dispatcher EIP
Before digging into implementation details, let's take a look at the relationship between the example scenario and the Message Dispatcher EIP by comparing their core components.
Figure 1: Message Dispatcher EIP | Figure 2: Message Dispatcher Example Scenario |
---|---|
Sender | Simple Stock Quote Client |
Messages | Simple Stock Quote Requests |
Message Dispatcher | Message Endpoint, Load-Balance Endpoint |
Performers | Simple Stock Quote Server Instances |
...
Simulating the sample scenario
Repeatedly send several requests to the ESB using the stockquote client as follows:
ant stockquote -Dtrpurl=http://localhost:8280/ -Dsymbol=Foo
...
Let's investigate the elements of the ESB configuration in detail. The line numbers below refer to the ESB configuration in step 3 above.
- endpoint [line 14 in ESB config] - The endpoint element defines the endpoint to which a request should be sent to.
- loadbalance [line 15 in ESB config] - The loadbalance configuration defines a set of endpoints to which incoming requests are distributed to using a particular algorithm. In this example, the algorithm distributes messages in a weighted round robin manner.