AmqpSidecar.Consumer (amqp_sidecar v0.1.0)

Copy Markdown

Dynamically creates AMQP consumers based on the configuration.

Rules are matched by exchange plus AMQP topic patterns (* matches one word, # matches zero or more words). Messages that match no rule are acknowledged and dropped with a warning so they don't poison the queue. A failed forward rejects the message with requeue so RabbitMQ redelivers it.

Summary

Functions

Returns a specification to start this module under a supervisor.

Matches a rule by exchange and topic routing key. * matches exactly one word, # matches zero or more words.

AMQP topic pattern matching.

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

match_rule(rules, exchange, routing_key)

@spec match_rule([map()], String.t(), String.t()) :: map() | nil

Matches a rule by exchange and topic routing key. * matches exactly one word, # matches zero or more words.

start_link(config)

topic_match?(pattern, key)

@spec topic_match?(String.t(), String.t()) :: boolean()

AMQP topic pattern matching.