RabbitMQ Routing Key 匹配规则:'inform.#.email.#' 和 'inform.*.sms' 的匹配项
'inform.abc.email.def' 能够被 Routing Key 'inform.#.email.#' 匹配。
因为 'inform.#.email.#' 中的 '#' 代表匹配一个或多个字符,所以它可以匹配任何以 'inform.' 开头,中间包含 'email.',结尾为任意字符的消息。
而 'inform..sms' 中的 '' 代表匹配零个或多个字符,因此它只能匹配以 'inform.' 开头,中间包含 'sms',且中间部分没有其他字符的消息。
综上,'inform.abc.email.def' 能够被 Routing Key 'inform.#.email.#' 匹配,但不能被 'inform.*.sms' 匹配。
AI 优化版
原文地址:https://www.cveoy.top/t/topic/oiak 著作权归作者所有。请勿转载和采集!