AMQPX v1.0.0 AMQPX.RoutingKeyMatcher View Source

Link to this section Summary

Functions

Checks if a routing key matches a topic-style pattern

Link to this section Functions

Checks if a routing key matches a topic-style pattern.

iex> AMQPX.RoutingKeyMatcher.matches?(“a”, “a”) true

iex> AMQPX.RoutingKeyMatcher.matches?(“a”, “b”) false

iex> AMQPX.RoutingKeyMatcher.matches?(“a.c”, “a.c”) true

iex> AMQPX.RoutingKeyMatcher.matches?(“a.c”, “b.c”) false

iex> AMQPX.RoutingKeyMatcher.matches?(“c.a”, “c.b”) false

iex> AMQPX.RoutingKeyMatcher.matches?(“a.b.c”, “a.*.c”) true

iex> AMQPX.RoutingKeyMatcher.matches?(“a.c”, “a.*.c”) false

iex> AMQPX.RoutingKeyMatcher.matches?(“a.b.c.d”, “a.*.d”) false

iex> AMQPX.RoutingKeyMatcher.matches?(“a”, “#”) true

iex> AMQPX.RoutingKeyMatcher.matches?(“a.b.c”, “#”) true

iex> AMQPX.RoutingKeyMatcher.matches?(“a”, “a.#”) true

iex> AMQPX.RoutingKeyMatcher.matches?(“a”, “#.a”) true

iex> AMQPX.RoutingKeyMatcher.matches?(“a.b”, “a.#”) true

iex> AMQPX.RoutingKeyMatcher.matches?(“a.c”, “a.#.c”) true

iex> AMQPX.RoutingKeyMatcher.matches?(“a.b.c”, “a.#.c”) true

iex> AMQPX.RoutingKeyMatcher.matches?(“a.b.c.d”, “a.#.d”) true