multi profile uie persistence, match accross VS
hi
I have an application that need to persist on the same backend. The application makes first a HTTPS connection, then a TCP connection and would eventually switch to udp connection. It use its own message ID mechanism and this is present in the HTTP request, the TCP and UDP payload. I wrote 3 irules for universal persistence and all are able to find properly that message id (uid) for the persistence. I have configured a "match accross virtual server" for all 3 persistence profiles. It results that we create a persistence record with the persistence irule of HTTPS-VS but it won't be reused for the tcp or udp connection. Here my irules:
HTTPS:
when HTTP_REQUEST {
if { [HTTP::query] starts_with "uid=" } {
set uid [findstr [HTTP::query] uid= 4 ]
if { not (($uid eq "") || ($uid eq "(null)")) }{
persist uie $uid
log local0. "using persistence for UID ($uid): [persist lookup uie $uid]"
}
}
}
TCP:
when CLIENT_ACCEPTED {
TCP::collect 24
}
when CLIENT_DATA {
set offset_header 16
set clientData [TCP::payload]
binary scan $clientData @${offset_header}ccii sig ver size UIDdata
log local0. "sig=[format %x [expr {$sig & 0xFF}]] , ver=$ver, size=$size, UID=$UIDdata"
persist uie $UIDdata
log local0. "using persistence for UID ($UIDdata): [persist lookup uie $UIDdata]"
TCP::release
}
UDP:
when CLIENT_DATA {
set offset_header 8
set clientData [UDP::payload 24]
binary scan $clientData @${offset_header}ccii sig ver size UIDdata
log local0. "sig=[format %x [expr {$sig & 0xFF}]] , ver=$ver, size=$size, UID=$UIDdata"
persist uie $UIDdata
log local0. "using persistence for UID ($UIDdata): [persist lookup uie $UIDdata]"
}
In the logs we see the following:
http_uie : using persistence for UID (4): /Common/HTTPS_Pool 192.168.2.50 443
tcp_uie : sig=ac , ver=8, size=293, UID=4
tcp_uie : using persistence for UID (4):
udp_uie : sig=ad , ver=8, size=59, UID=4
udp_uie : using persistence for UID (4):
udp_uie : sig=ad , ver=8, size=59, UID=4
udp_uie : using persistence for UID (4):
and the persistence table shows the entries
Sys::Persistent Connections
universal 4 192.168.1.4:443 192.168.2.50:443 (tmm: 1)
universal 4 192.168.1.4:443 192.168.2.50:443 (tmm: 0)
Total records returned: 2
so my question is: why the subsequent uie persistence doesn't work ?
Thanks
Alex