Routing Key Matching

Last updated: 2020-02-26 21:01:43

PDF

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].

Instructions

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.

Use Limits

  • 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.

Wildcard description

:: (Asterisk) can be a substitute for a word (a sequence of alphabetic string)

(Pound sign) can be used to match one or more characters

Example:

Subscribers to. * .0 "receive all messages for" 1.any characters.0 ".

Subscribers to "1.room.0" receive all messages for "1.2.3.4.4.2.2.0". (It can be any elements in between.)

  • If the subscriber is "#", all message subscribers can receive it.