RabbitMQ Flashcards
RabbitMQ
Brokers provide 4 exchange types:
Direct (the default), Fanout, Topic, and Headers
RabbitMQ
What command is used to create an exchange?
exchange.declare
RabbitMQ
What is the AMQP model?
Messages are published to exchanges (aka mailboxes).
Exchanges then distribute message copies to queues using rules called bindings.
Then AMQP brokers either push messages to consumers subscribed to queues, or consumers pull messages from queues on demand.
RabbitMQ
When will a broker completely remove a message from a queue?
Immediately after it has been delivered OR if message acknowledgements are in use, when it receives a notification for that message (or group of messages)
RabbitMQ
What happens when a message cannot be routed?
Messages may be returned to publishers, dropped, or placed into a “dead letter queue”
RabbitMQ
In AMQP 0-9-1, messages are load balanced between what?
consumers — not between queues
RabbitMQ
What is a Fanout Exchange?
A fanout exchange routes messages to all of the queues that are bound to it and the routing key is ignored.
RabbitMQ
What is a Topic Exchange?
Topic exchanges route to queues whose binding pattern matches the message’s routing key. Topic exchanges have a very broad set of use cases including various publish/subscribe pattern variations.
RabbitMQ
What do special characters “*” and “#” do when used in bindings?
“*” can substitute for exactly one word.
“#” can substitute for zero or more words.
RabbitMQ
What is a Headers Exchange?
A headers exchange is routes on message headers rather than a routing key.
RabbitMQ
What command is used to create an queue?
queue.declare
RabbitMQ
Queues that are not durable are called ____
transient
RabbitMQ
Queues that are not transient are called ____
durable
RabbitMQ
Are messages of a durable queue durable messages?
No, only persistent messages are recoverable.
RabbitMQ
What are Bindings?
Bindings are rules (with an optional routing key) that exchanges use to route messages to queues.
RabbitMQ
What is a good Binding analogy?
Queue is like your destination in New York city.
Exchange is like JFK airport.
Bindings are routes from JFK to your destination. There can be zero or many ways to reach it.
RabbitMQ
Why would a message not be routed to a queue?
Because there are no (matching) bindings for the exchange it was published to.
RabbitMQ
How can consumers receive messages?
Push or pull
RabbitMQ
What is a Channel?
A group of lightweight connections that share a single TCP connection.
RabbitMQ
What are Virtual hosts (vhosts)?
vhosts are completely isolated environments in which AMQP entities live.