Forum Discussion
Dispatch messages from a single connection to pool members
I tried to follow your example, but have not succeeded yet. Using "\r\n\r\n" to find the end of message may not work in my application, which does not use HTTP. Is it standard for HTTP messages? In your example, you don't handle USER_REQUEST event. Is there a default action for USER_REQUEST event?
My understanding is whether I use length field found in message header or use "\r\n\r\n" to find the end of a message, as long as I call TCP::notify request, USER_REQUEST should be triggered. In my case, it has never been triggered. What prevents it from happening?
Below is the latest configuration I used:
datastor {
low water mark 80
high water mark 92
}
deduplication {}
shell write partition Common
configsync {
password crypt "****"
}
route default inet {
vlan external
}
monitor MYMBLB {
defaults from inband
}
node 10.124.66.35 {}
node 10.124.66.48 {}
pool MYMBLB_pool {
monitor all MYMBLB
members {
10.124.66.35:cslistener {}
10.124.66.48:cslistener {}
}
}
snat snat_one_ip_test {
translation 10.124.6.35
origins {
10.124.66.35
10.124.66.48
}
vlans external enable
}
rule MYRULES {
when CLIENT_ACCEPTED {
log local0.debug "Get a connection"
set client_closed 0
TCP::collect 1000
}
when CLIENT_CLOSED {
set client_closed 1
}
when SERVER_CONNECTED {
log local0.debug "Server_connected"
after 1000 -periodic if {$client_closed} {TCP::close}
TCP::collect
}
when CLIENT_DATA {
log local0.debug "in CLIENT_DATA"
binary scan [TCP::payload] II head rlen
if {($head & 0x3) == 1} {
if {[TCP::payload length] < $rlen} {
TCP::collect $rlen
log local0.debug "a message is received"
TCP::release $rlen
TCP::notify request
log local0.debug "requested"
}
}
TCP::collect
}
}
virtual MYMBLBLB {
pool MYMBLB_pool
destination 10.124.6.35:cslistener
ip protocol tcp
rules MYRULES
profiles {
mblb {}
tcp {}
}
}
Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com