Persistence based on several criteria

We are trying to manage Tibco to Siebel load balancing. Any suggestions would be appreciated. Below are the requirements as stated by the application owners:

Persistence is required since Tibco creates an application-level session, but source IP:Port persistence isn’t sufficient, as source port can change without application session closing.

To account for that event, the example below, evaluated in order, searches for a string in the TCP data which contains a specifier for the exact Siebel server that owns the application session.

***************

When a TCP connection occurs:

If the TCP payload contains “/pcrm” and “/!3” use pool procrm05pool and set persistence to client IP:Port

Else if the TCP payload contains “/pcrm” and “/!b” use pool procrm06pool and set persistence to client IP:Port

Else if the client IP:Port is already in the persistence table, persist according to current status in persistence table

Else use default pool and set persistence based on client IP:Port

Same example provided by the application owners:

→ Example code to manage Tibco → Siebel load balancing

If (TCP:Payload contains “/pcrm” and “/!3”)

Then

Route to procrm05 pool

Set IP:Port persistence to procrm05 server pool

Else If (TCP:Payload contains “/pcrm” and “/!b”)

Then

Route to procrm06 pool

Set IP:Port persistence to procrm06 server pool

Else

If (IP:Port combination is already in persistence table)

Then

Route per persistence table status

Else

Route to default pool (load balance over both servers)

Set IP:Port persistence to chosen server

End If

End If

Here is what I have so far… (syntax is correct, but not sure if it will work)

when CLIENT_ACCEPTED {

TCP::collect

set client_exists ([IP::client_addr]:[TCP::client_port]) }

when CLIENT_DATA {

if { [TCP::payload] contains “/pcrm” and “/!3”}{

pool procrm05pool

persist uie “[IP::client_addr]:[TCP::client_port]”

}

elseif { [TCP::payload] contains “/pcrm” and “/!b”}{

pool procrm06pool

persist uie “[IP::client_addr]:[TCP::client_port]”

}

elseif { [info exists $client_exists] }{

persist uie $client_exists

}

else {

pool defaultpool

persist uie “[IP::client_addr]:[TCP::client_port]”

}

}

Thank you so much Colin!! I will get with the Siebel application team and test this iRule.

I truly appreciate your quick response!!

Michael

I definitely will. Thank you for your assistance.