Hi!,
    Can anyone help me explain this redirector behavior. I was testing a load 
balancing restlet web service basically it just redirect a request to the 
destination. 
    Example http://localhost:8183/webservice/resource1/test this will be 
redirected to any of the specified route destination in a round robin, example 
destination http://localhost:50011/test as expected.
    With our test case scenario of actual production issues that might occur, 
we stop on retlet web service of the destination let say 
http://localhost:50012. and we do the following
     First Request: http://localhost:8183/webservice/resource1/test --> 
redirected to http://localhost:50011/test -->it is successful
     Second Request: http://localhost:8183/webservice/resource1/test --> 
redirecting to http://localhost:50012/test --> but it is not showing or it like 
requesting indefinitely, no output is receive, until I stop the browser.
     
     "INFO: Redirecting via client dispatcher to: http://localhost:50012/test1"; 
--> last log
     
     Question does the VirtualHost have any means of detecting that the 
destination is not online, if can't determine it? how to solve this issue?

///////////////////////////////////////////////////////////////////////////////////////////////////////
      
public static void main(String[] args) throws Exception{
  Component component=new Component();
  component.getServers().add( Protocol.HTTP, 8182 ); // Private
  component.getServers().add( Protocol.HTTP, 8183); // Public
                
  //Add a new HTTP client
  component.getClients().add( Protocol.HTTP );
                
 /**
  *  Create virtual Host for Private use for administrative purposes
  */
  VirtualHost privateHost = new VirtualHost(component.getContext());
                
  privateHost.setHostDomain("localhost");
  privateHost.setHostPort("8182");
                
  VirtualHost proxyHost = new VirtualHost(component.getContext());
                
  proxyHost.setHostDomain("localhost");
  proxyHost.setHostPort("8183");
  proxyHost.setRoutingMode(Router.MODE_NEXT_MATCH);
                
  /**
   * Load balancing path
   */
 proxyHost.attach("/webservice/resource1",new 
Redirector(component.getContext(), "http://localhost:50011{rr}";,  
Redirector.MODE_SERVER_OUTBOUND));
 proxyHost.attach("/webservice/resource1",new 
Redirector(component.getContext(), "http://localhost:50012{rr}";,  
Redirector.MODE_SERVER_OUTBOUND));
                
  component.getHosts().add(privateHost);
  component.getHosts().add(proxyHost);
                
  component.start();
                        
}
///////////////////////////////////////////////////////////////////////////////////////////////////////
    
    I appreciate your feedback and Thanks

Sincerely,
Gerald G. Ternola

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

Reply via email to