This documentation is for WSO2 Enterprise Integrator version 6.1.1 . View documentation for the latest release in the 6.x.x family and the latest release in the 7.x.x family.

All docs This doc

Versions Compared

Key

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

...

For a list of prerequisites, see Prerequisites to Start see the prerequisites for starting the ESB Samplessamples.

Building the sample

The XML configuration for this sample is as follows: 

...

This configuration file  synapse_sample_55.xml is available in the <ESB<EI_HOME>/repositorysamples/samples service-bus directory.

To build the sample

...

  1. Run the following command from the <ESB<EI_HOME>/samples/axis2Client directory.

    Code Block
    languagebash
    ant loadbalancefailover -Dmode=session
  2. While the client is running, stop the server named MyServer1.

Analyzing the output

When the client is run, you will see will see the following output following output on the client console:

Code Block
...
[java] Request: 222 Session number: 0 Response from server: MyServer1
[java] Request: 223 Session number: 0 Response from server: MyServer1
[java] Request: 224 Session number: 1 Response from server: MyServer1
[java] Request: 225 Session number: 2 Response from server: MyServer3
[java] Request: 226 Session number: 0 Response from server: MyServer1
[java] Request: 227 Session number: 1 Response from server: MyServer1
[java] Request: 228 Session number: 2 Response from server: MyServer3
[java] Request: 229 Session number: 1 Response from server: MyServer1
[java] Request: 230 Session number: 1 Response from server: MyServer1
[java] Request: 231 Session number: 2 Response from server: MyServer3
...

...

When MyServer1 is stopped while running the sample, you will see that all successive requests for session 0 are directed to MyServer2, which is the backup server for MyServer1's failover group.

The output on the client console will be as follows:

Code Block
...
[java] Request: 529 Session number: 2 Response from server: MyServer3
[java] Request: 530 Session number: 1 Response from server: MyServer1
[java] Request: 531 Session number: 0 Response from server: MyServer1
[java] Request: 532 Session number: 1 Response from server: MyServer1
[java] Request: 533 Session number: 1 Response from server: MyServer1
[java] Request: 534 Session number: 1 Response from server: MyServer1
[java] Request: 535 Session number: 0 Response from server: MyServer2
[java] Request: 536 Session number: 0 Response from server: MyServer2
[java] Request: 537 Session number: 0 Response from server: MyServer2
[java] Request: 538 Session number: 2 Response from server: MyServer3
[java] Request: 539 Session number: 0 Response from server: MyServer2
...

By analysing the above output, you will see that all requests for session 0 are directed to MyServer2 after the request 534. Therefore, you can come to the conclusion that MyServer1 was stopped after request 534.

 

Excerpt
hiddentrue

Sample on Session affinity load balancing between fail over endpoints

 

 

...