Package xsul.dispatcher.rpc

A simple HTTP proxy to forward RPC invocations.


Class Summary
DispatcherRPC The main class to start the RPC Dispatcher.

Package xsul.dispatcher.rpc Description

A simple HTTP proxy to forward RPC invocations.

How to start and use it?

The Dispatcher


Before to start the Dispatcher, you have to configure it.

By default the Dispatcher starts on 80 port. To change the port number, edit the Dispatcher's properties file:


To compile the Dispatcher go to the directory: xsul/java and run this command:

$ ant dispatcher

To launch the Dispatcher:

$ cd XSUL_HOME/java
$ java -cp `./` xsul.dispatcher.rpc.DispatcherRPC


It is a very simple sample with one Web Service and multi clients which send requests to the Dispatcher and the Dispatcher forwards requests to the Web Service.

First, you have to configure the Routing Table of the Dispatcher to map virtual path with real Web Services addresses.

A virtual path is the path in requests from clients. The Dispatcher maps this path with its routing table to find the real address of the mapped Web Service.

Configure Routing Table

Edit the file:

To add a new element: virtual-path=host:port/path. Where virtual-path is the path in clients HTTP requests. The host:port/path is the address of the Web Service which the Dispatcher forwards the requests.

For this sample the Web Service is running in the same host of the Dispatcher. Just add this line in the routing table:


To run the Web Service on a different host just modify the address with the good one.

Start the Web Service

Start the EchoServer:

$ cd XSUL_HOME/java
$ java -cp ` ./` xsul_sample_hello.EchoServer 60002

Start the Dispatcher

To launch the Dispatcher:

$ cd XSUL_HOME/java
$ java -cp `./` xsul.dispatcher.rpc.DispatcherRPC

For more information see the Dispatcher section.

Start Multi Clients

You can start n clients to send requests to the Dispatcher.

Start clients:

$ cd XSUL_HOME/java
$ java -cp `./` xsul_sample_hello.EchoMultiClients n dispatcher_address

Where n is the number of clients to launch, example:10 or 25.

Where dispatcher_address is the address of the Dispatcher, example: http://localhost/foo or

For our local sample:

$ java -cp `./` xsul_sample_hello.EchoMultiClients 10 http://localhost/test

Alexandre di Costanzo
Last modified: Thu Aug 19 14:31:25 EST 2004

IU Extreme! Lab (