If HTTP::status is 404 send the request to a different pool.

If the response is a 404 I want that client to try the same path on a different pool. I can make a dataclass with the HTTP::path and when it matches that class, send it to that pool but I am trying to come up of a way to not have to manage a list of paths as exceptions. I tried this but it gives a connection reset instead of sending it to the 2nd pool:

when HTTP_REQUEST { set request [HTTP::request]}

when HTTP_RESPONSE { if { [HTTP::status] == 404 } { pool pool_2 HTTP::retry $request } }

HTTP::retry $request only works for the current pool. Is there a way to say

1) Use a different pool (and specify the pool)

2) HTTP::retry $request

There is an interesting example on the HTTP::retry Wiki page here that might be of interest to you. It’s functionality is limited to HTTP GET requests but it may work for you. Scroll down to the second example labeled " Retry 404 responses once to a second pool"

 

Take a look at LB::reselect.

 

 

The HTTP::retry page with the 404 example is working. Thanks!