Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This section explains, through an example scenario, how the Competing Consumers EIP can be implemented using WSO2 ESB. The following topics are covered:

Table of Contents

...

Competing Consumers EIP (Function 1)Competing Consumers Example Scenario (Function 2)
SenderSimple Stock Quote Client
MessagesSimple Stock Quote Requests with Load-Balance Endpoint
Consumer/ReceiverSimple Stock Quote Server Instances

...

  1. Download and install WSO2 ESB from http://wso2.com/products/enterprise-service-bus. For a list of prerequisites and step-by-step installation instructions, refer to Getting Started Installation Guide in the WSO2 ESB documentation.
  2. Start three sample Axis2 server instances on ports 9000, 9001, and 9002. For instructions, refer to the section Setting Up the ESB Samples Setup - Starting Sample Back-End Servicesthe Axis2 server in the WSO2 ESB documentation.

...

Simulating the sample scenario

Repeatedly send several requests to the ESB using the stockquote client as follows:

...

Let's investigate the elements of the ESB configuration in detail. The line numbers below refer to the ESB configuration shown above.

  • endpoint [line 13 in ESB config] - Defines the endpoint where the request should be sent. 
  • loadbalance [line 14 in ESB config] - Defines a set of endpoints where incoming requests are distributed using a particular algorithm. In this example, the algorithm distributes messages in a round-robin manner.