Route Query
We need a peer service in route_query escaper. This page describes the protocol we used to communicate with the peer service.
The peer service should listen on a UDP port, which may be IPv4 or IPv6 based, we will sending requests to this port.
Each UDP packet from our side to the peer service will contains exactly one request. And each UDP packet from the peer service should contains exactly one response.
Both the request and the response are structured data and should be encoded in msgpack format.
The root of the request and the response should be a map, we will describe the keys of them in the following.
request
id
required, type: uuid binary
Set the id of the request.
user
required, type: string
Set the username of the proxy request. The value may be an empty string if auth is disabled on the proxy side.
host
required, type: string
Set the target host of the proxy request. May be a domain or an IP address.
client_ip
Set the client ip address. This will be set only of query_pass_client_ip is enabled.
response
id
required, type: uuid binary | uuid string
Set the id of the corresponding request.
nodes
optional, type: string | seq
Set the next escaper(s) those can be selected.
For seq value, each of its element must be weighted metric node name.
If empty, the fallback node escaper config will take effect.
default: empty
ttl
optional, type: u32
Set the expire ttl of this response.
If 0, the protective cache ttl escaper config will take effect
Note
expired records will be cached some more time before cleared, see cache_vanish_wait for more info.
default: 0