Hi

I'm experimenting using restlets to provide a simple REST reverse proxy. I have 
the following test which works fine, using round robin, as far as it goes:

Component component=new Component();
   component.getServers().add(Protocol.HTTP, 8080); 
   component.getClients().add(Protocol.HTTP);
   VirtualHost proxyHost = new VirtualHost(component.getContext());

   proxyHost.setHostDomain("myLocalHost");
   proxyHost.setHostPort("8080");

        // round robin
   proxyHost.setRoutingMode(Router.MODE_NEXT_MATCH);
   proxyHost.attach("/",new 
Redirector(null,"http://192.168.213.69:61600/{rr}";));
   proxyHost.attach("/",new 
Redirector(null,"http://192.168.213.70:61600/{rr}";));

   component.getHosts().add(proxyHost);
   component.start();
   component.updateHosts();

My question is, how can I modify this test to redirect all HTTP requests out to 
just a single server, should one of the two servers, given above, fail? In 
addition, when the failed server comes back online, I need the normal round 
robin behaviour to automatically resume, after a short delay.

Can I do this easily by configuring either the default (or an extension) 
connector?

Many thanks for any comments.

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2662350

Reply via email to