Routing Key Matching
Last updated: 2020-02-26 21:01:43PDF
CMQ's routing key matching function is similar to rabbitMQ's exchange queue, which can be used for message filtering to enable subscribers to get different messages according to different conditions. When creating a topic, you can turn on [Route matching key].
Binding key and Routing key are used at the same time, fully compatible with rabbitmq topic matching mode. The Routing key for sending messages is in the messages sent by the client. The Binding key for subscription creation is used to bind the topic and the subscriber.
- The number of Binding key does not exceed 5. The length of a single binding key is < = 64 bytes, which is used to indicate the routing path to send the message, with a maximum of 15 ".", that is, a maximum of 16 phrases.
- The number of Routing key consists of 1 string. The length of a single Routing key is < = 64 bytes, which is used to indicate the routing path to send the message, with a maximum of 15 ".", that is, a maximum of 16 phrases.
:: (Asterisk) can be a substitute for a word (a sequence of alphabetic string)
(Pound sign) can be used to match one or more characters
Subscribers to. * .0 "receive all messages for" 1.any characters.0 ".
Subscribers to "1.room.0" receive all messages for "188.8.131.52.184.108.40.206". (It can be any elements in between.)
- If the subscriber is "#", all message subscribers can receive it.