I would like to clarify one point related to fetches and data availability.
I have the following setup related to MQTT backed sharding:
acl data_in_buffer req.len ge 4
tcp-request content set-var(txn.clientid) req.payload(0,0),mqtt_field_value(connect,client_identifier) if data_in_buffer
and later I would like to do:
use_backend %[lua.shard_selection('mqtt', txn.clientid)]
what is not clear for me, is how all of that will behave with partial data, it might be not a complete MQTT packet, it might be proxy protocol, obviously, I want to select a backend iff client_identifier is extracted,
so I have to use ACL there, but I’m, not sure how to link extraction of client_identifier to txn.clientid to this?
update
it looks like I have to do something like, still not clear if this is correct:
acl data_in_buffer req.len ge 4
tcp-request content set-var(txn.clientid) req.payload(0,0),mqtt_field_value(connect,client_identifier) if data_in_buffer
use_backend %[lua.shard_selection('mqtt', txn.clientid)] if { txn.clientid -m len gt 0 }