Part 1. Foundational RabbitMQ
RabbitMQ’s features and benefits
- RabbitMQ and Erlang
- RabbitMQ and AMQP
Who’s using RabbitMQ, and how?
The advantages of loosely coupled architectures
- Decoupling your application
- Decoupling database writes
- Seamlessly adding new functionality
- Replication of data and events
- Multi-master federation of data and events
- The Advanced Message Queuing model
How to speak Rabbit: the AMQ Protocol
AMQP as an RPC transport
- Kicking off the conversation
- Tuning in to the right channel
AMQP’s RPC frame structure
- AMQP frame components
- Types of frames
- Marshaling messages into frames
- The anatomy of a method frame
- The content header frame
- The body frame
Putting the protocol to use
- Declaring an exchange
- Declaring a queue
- Binding a queue to an exchange
- Publishing a message to RabbitMQ
- Consuming messages from RabbitMQ
- Writing a message publisher in Python
- Getting messages from RabbitMQ
An in-depth tour of message properties
Using properties properly
Creating an explicit message contract with content-type
Reducing message size with gzip and content-encoding
Referencing messages with message-id and correlation-id
- Message-id
- Correlation-id
Born-on dating: the timestamp property
Automatically expiring messages
Balancing speed with safety using delivery-mode
Validating message origin with app-id and user-id
- app-id
- user-id
Getting specific with the message type property
Using reply-to for dynamic workflows
Custom properties using the headers property
The priority property
A property you can’t use: cluster-id/reserved
Performance trade-offs in publishing
Balancing delivery speed with guaranteed delivery
- What to expect with no guarantees
- RabbitMQ won’t accept non-routable messages with mandatory set
- Publisher Confirms as a lightweight alternative to transactions
- Using alternate exchanges for unroutable messages
- Batch processing with transactions
- Surviving node failures with HA queues
- HA queues with transactions
- Persisting messages to disk via delivery-mode 2
When RabbitMQ pushes back
- Checking the connection status with rabbitpy
- Using the management API for connection status
Don’t get messages; consume them
Basic.Get vs. Basic.Consume
- Basic.Get
- Basic.Consume
Performance-tuning consumers
- Using no-ack mode for faster throughput
- Controlling consumer prefetching via quality of service settings
- Using transactions with consumers
Rejecting messages
- Basic.Reject
- Basic.Nack
- Dead letter exchanges
Controlling queues
- Temporary queues
- Permanent queues
- Arbitrary queue settings
Message patterns via exchange routing
Simple message routing using the direct exchange
- Creating the application architecture
- Creating the RPC worker
- Writing a simple RPC publisher
Broadcasting messages via the fanout exchange
- Modifying the facial detection consumer
- Creating a simple image-hashing consumer
• Selectively routing messages with the topic exchange
• Selective routing with the headers exchange
• Exchange performance benchmarking
• Going meta: exchange-to-exchange routing
• Routing messages with the consistent-hashing exchange
Part 2. Managing RabbitMQ in the data center or the cloud
Scaling RabbitMQ with clusters
About clusters
- Clusters and the management UI
- Cluster node types
- Clusters and queue behavior
Cluster setup
- Virtual machine setup
- Adding nodes to the cluster
Cross-cluster message distribution
Federating exchanges and queues
- Federated exchanges
- Federated queues
Creating the RabbitMQ virtual machines
- Creating the first instance
- Duplicating the EC2 instance
Connecting upstream
- Defining federation upstreams
- Defining a policy
- Leveraging upstream sets
- Bidirectional federated exchanges
- Federation for cluster upgrades
Part 3. Integrations and customization
Using alternative protocols
MQTT and RabbitMQ
- The MQTT protocol
- Publishing via MQTT
- MQTT subscribers
- MQTT plugin configuration
STOMP and RabbitMQ
- The STOMP protocol
- Publishing messages
- Consuming messages
- Configuring the STOMP plugin
- Using STOMP in the web browser
Stateless publishing via HTTP
- How statelessd came to be
- Using statelessd
- Operational architecture
- Publishing messages via statelessd
Database integrations
The pg_amqp PostgreSQL extension
- Installing the pg_amqp extension
- Configuring the pg_amqp extension
- Publishing a message via pg_amqp
Listening to PostgreSQL notifications
- Installing the PostgreSQL LISTEN exchange
- Policy-based configuration
- Creating the exchange
- Creating and binding a test queue
- Publishing via NOTIFY
Storing messages in InfluxDB
- InfluxDB installation and setup
- Installing the InfluxDB storage exchange
- Creating a test exchange
- Testing the exchange
Security
How to secure lab MQ, tips