Forum Discussion

JT_46093's avatar
Icon for Nimbostratus rankNimbostratus
Dec 23, 2011

iRule using web service for LB decision




I want to write an iRule that contacts a web service to find out which back end server to send the connection to. I know this would not be fast but the connections I'm balancing are long lived connections so a slower intial connection is not a problem.



I was hoping to use the features in TCL to do this. Notably...



The idea was to contact the web service on CLIENT_ACCEPTED.


Process the response from the web service to find the server and port to use


use the node command to define the back end machine the BIG-IP will send the traffic to



The traffic being balanced is not HTTP, just TCP. So the only HTTP involved is where the irule is acting as a web client to the web service to find out the machine to use.



When I have tried this it seems that the http parts of TCL are not available in iRules. Is this right? Can anyone think of a way to do this?




5 Replies

  • is sideband usable?



    sideband wiki




    v11 iRules: Intro to Sideband Connections by Colin

  • Thanks for the quick response.



    Yes I think sideband would do it. However I don't have a version 11 BIG-IP :-(
  • what about this one?



    Conditioning iRule Logic on External Information - 01 - HTTP::retry by Deb

  • Yes I had a look at that but unfortunatly the connection I'm trying to balance isn't HTTP so I have no way to trigger the HTTP events of HTTP::retry.
  • Colin_Walker_12's avatar
    Historic F5 Account
    Could the web service be made to respond to a DNS query with the information needed? If so we could use the RESOLV::lookup command to fire off a request and then you could act on the response.



    Just a thought. :)