Professional Documents
Culture Documents
with RabbitMQ
Roland Guijt
INDEPENDENT SOFTWARE DEVELOPER AND TRAINER
@rolandguijt www.rmgsolutions.nl
What is RabbitMQ?
Installing RabbitMQ
Module
Overview Terminology
Exchange types
Sending messages
Receiving messages
The management plugin
Reliability options
Virtual hosts and security
Message broker
Erlang
Open source
Commercially supported
Standardized protocols
Plugins
Many clients
Clustering
Support for various OS, cloud, and
container platforms
Installing Windows version has installer
Management plugin
Installing the Management Plugin
RabbitMQ Terminology
Connection
Service Channels RabbitMQ
RabbitMQ Terminology
Producer Consumer
RabbitMQ Ack
Exchange Queue
Binding
Exchange Types: Direct
Exchange Queue
Routing Keys
Queue
Routing key:
“fast”
Routing key: “fast”
Queue
Routing key:
“normal”
Queue
Exchange Routing key:
“slow”
Exchange Types: Topic
Queue
Routing key:
“package.*.international”
Routing key: “package.fast.national”
Queue
Routing key:
“#.national”
Queue
Exchange Routing key:
“package.fast.national”
Exchange Types: Fanout
Queue
Exchange Queue
Queue
var messageProperties = Correlating a message
channel.CreateBasicProperties();
messageProperties.CorrelationId =
- Process identifier
Guid.NewGuid().ToString(); - Groups messages belonging to
the same process
- Typically stored in the
service database
- Can also be done using
message property
Reliability Options
Connection and
Reply to sender
topology recovery
Consumer tells RabbitMQ to delete the
message from the queue
NoAck bool when registering consumer
Unacked messages are requeued
Acks Redelivered flag
Implement redelivered strategy yourself
Dead letter exchange
Producer gets an acknowledgement when
message is queued
Publisher
Confirms Possible responses: Ack and Nack
Implement re-send strategy yourself
Publisher Confirms in Code
channel.ConfirmSelect();