Preface |
|
xiii | |
Acknowledgments |
|
xiv | |
About This Book |
|
xv | |
Part 1: RabbitMQ And Application Architecture |
|
1 | (132) |
|
|
3 | (15) |
|
1.1 RabbitMQ's features and benefits |
|
|
4 | (3) |
|
|
5 | (1) |
|
|
6 | (1) |
|
1.2 Who's using RabbitMQ, and how? |
|
|
7 | (1) |
|
1.3 The advantages of loosely coupled architectures |
|
|
8 | (8) |
|
Decoupling your application |
|
|
10 | (1) |
|
Decoupling database writes |
|
|
11 | (1) |
|
Seamlessly adding new functionality |
|
|
12 | (1) |
|
Replication of data and events |
|
|
12 | (1) |
|
Multi-master federation of data and events |
|
|
13 | (1) |
|
The Advanced Message Queuing model |
|
|
14 | (2) |
|
|
16 | (2) |
|
2 How to speak Rabbit: the AMQ Protocol |
|
|
18 | (20) |
|
2.1 AMQP as an RPC transport |
|
|
19 | (2) |
|
Kicking off the conversation |
|
|
20 | (1) |
|
Tuning in to the right channel |
|
|
20 | (1) |
|
2.2 AMQP's RPC frame structure |
|
|
21 | (6) |
|
|
21 | (1) |
|
|
22 | (1) |
|
Marshaling messages into frames |
|
|
23 | (1) |
|
The anatomy of a method frame |
|
|
24 | (2) |
|
|
26 | (1) |
|
|
26 | (1) |
|
2.3 Putting the protocol to use |
|
|
27 | (5) |
|
|
27 | (1) |
|
|
28 | (1) |
|
Binding a queue to an exchange |
|
|
29 | (1) |
|
Publishing a message to RabbitMQ |
|
|
29 | (1) |
|
Consuming messages from RabbitMQ |
|
|
30 | (2) |
|
2.4 Writing a message publisher in Python |
|
|
32 | (4) |
|
2.5 Getting messages from RabbitMQ |
|
|
36 | (1) |
|
|
37 | (1) |
|
3 An in-depth tour of message properties |
|
|
38 | (20) |
|
3.1 Using properties properly |
|
|
39 | (2) |
|
3.2 Creating an explicit message contract with content-type |
|
|
41 | (2) |
|
3.3 Reducing message size with gzip and content-encoding |
|
|
43 | (2) |
|
3.4 Referencing messages with message-id and correlation-id |
|
|
45 | (1) |
|
|
45 | (1) |
|
|
45 | (1) |
|
3.5 Born-on dating: the timestamp property |
|
|
46 | (1) |
|
3.6 Automatically expiring messages |
|
|
47 | (1) |
|
3.7 Balancing speed with safety using delivery-mode |
|
|
48 | (1) |
|
3.8 Validating message origin with app-id and user-id |
|
|
49 | (2) |
|
|
50 | (1) |
|
|
51 | (1) |
|
3.9 Getting specific with the message type property |
|
|
51 | (1) |
|
3.10 Using reply-to for dynamic workflows |
|
|
52 | (1) |
|
3.11 Custom properties using the headers property |
|
|
53 | (1) |
|
3.12 The priority property |
|
|
54 | (1) |
|
3.13 A property you can't use: cluster-id/reserved |
|
|
54 | (1) |
|
|
55 | (3) |
|
4 Performance trade-offs in publishing |
|
|
58 | (21) |
|
4.1 Balancing delivery speed with guaranteed delivery |
|
|
59 | (16) |
|
What to expect with no guarantees |
|
|
60 | (2) |
|
RabbitMQ won't accept non-routable messages with mandatory set |
|
|
62 | (2) |
|
Publisher Confirms as a lightweight alternative to transactions |
|
|
64 | (2) |
|
Using alternate exchanges for unroutable messages |
|
|
66 | (2) |
|
Batch processing with transactions |
|
|
68 | (2) |
|
Surviving node failures with HA queues |
|
|
70 | (2) |
|
HA queues with transactions |
|
|
72 | (1) |
|
Persisting messages to disk via delivery-mode 2 |
|
|
72 | (3) |
|
4.2 When RabbitMQ pushes back |
|
|
75 | (3) |
|
Checking the connection status with rabbitpy |
|
|
77 | (1) |
|
Using the management API for connection status |
|
|
77 | (1) |
|
|
78 | (1) |
|
5 Don't get messages; consume them |
|
|
79 | (22) |
|
5.1 Basic.Get vs. Basic.Consume |
|
|
80 | (4) |
|
|
80 | (2) |
|
|
82 | (2) |
|
5.2 Performance-tuning consumers |
|
|
84 | (6) |
|
Using no-ack mode for faster throughput |
|
|
85 | (1) |
|
Controlling consumer prefetching via quality of service settings |
|
|
86 | (3) |
|
Using transactions with consumers |
|
|
89 | (1) |
|
|
90 | (4) |
|
|
90 | (1) |
|
|
91 | (1) |
|
|
92 | (2) |
|
|
94 | (5) |
|
|
94 | (3) |
|
|
97 | (2) |
|
|
99 | (1) |
|
|
99 | (2) |
|
6 Message patterns via exchange routing |
|
|
101 | (32) |
|
6.1 Simple message routing using the direct exchange |
|
|
102 | (13) |
|
Creating the application architecture |
|
|
103 | (4) |
|
|
107 | (3) |
|
Writing a simple RPC publisher |
|
|
110 | (5) |
|
6.2 Broadcasting messages via the fanout exchange |
|
|
115 | (4) |
|
Modifying the facial detection consumer |
|
|
116 | (1) |
|
Creating a simple image-hashing consumer |
|
|
117 | (2) |
|
6.3 Selectively routing messages with the topic exchange |
|
|
119 | (3) |
|
6.4 Selective routing with the headers exchange |
|
|
122 | (2) |
|
6.5 Exchange performance benchmarking |
|
|
124 | (1) |
|
6.6 Going meta: exchange-to-exchange routing |
|
|
125 | (2) |
|
6.7 Routing messages with the consistent-hashing exchange |
|
|
127 | (4) |
|
|
131 | (2) |
Part 2: Managing RabbitMQ In The Data Center Or The Cloud |
|
133 | (42) |
|
7 Scaling RabbitMQ with clusters |
|
|
135 | (13) |
|
|
136 | (6) |
|
Clusters and the management UI |
|
|
137 | (1) |
|
|
138 | (1) |
|
Clusters and queue behavior |
|
|
139 | (3) |
|
|
142 | (5) |
|
|
143 | (1) |
|
Adding nodes to the cluster |
|
|
144 | (3) |
|
|
147 | (1) |
|
8 Cross-cluster message distribution |
|
|
148 | (27) |
|
8.1 Federating exchanges and queues |
|
|
149 | (4) |
|
|
149 | (3) |
|
|
152 | (1) |
|
8.2 Creating the RabbitMQ virtual machines |
|
|
153 | (9) |
|
Creating the first instance |
|
|
153 | (6) |
|
Duplicating the EC2 instance |
|
|
159 | (3) |
|
|
162 | (11) |
|
Defining federation upstreams |
|
|
162 | (2) |
|
|
164 | (3) |
|
|
167 | (3) |
|
Bidirectional federated exchanges |
|
|
170 | (1) |
|
Federation for cluster upgrades |
|
|
171 | (2) |
|
|
173 | (2) |
Part 3: Integrations And Customization |
|
175 | (53) |
|
9 Using alternative protocols |
|
|
177 | (28) |
|
|
178 | (11) |
|
|
178 | (4) |
|
|
182 | (2) |
|
|
184 | (3) |
|
MQTT plugin configuration |
|
|
187 | (2) |
|
|
189 | (11) |
|
|
190 | (1) |
|
|
191 | (4) |
|
|
195 | (3) |
|
Configuring the STOMP plugin |
|
|
198 | (1) |
|
Using STOMP in the web browser |
|
|
199 | (1) |
|
9.3 Stateless publishing via HTTP |
|
|
200 | (3) |
|
How statelessd came to be |
|
|
200 | (1) |
|
|
201 | (1) |
|
|
202 | (1) |
|
Publishing messages via statelessd |
|
|
203 | (1) |
|
|
203 | (2) |
|
|
205 | (23) |
|
10.1 The pg_amqp PostgreSQL extension |
|
|
206 | (6) |
|
Installing the pg_amqp extension |
|
|
207 | (2) |
|
Configuring the pg_amqp extension |
|
|
209 | (1) |
|
Publishing a message via pg_amqp |
|
|
210 | (2) |
|
10.2 Listening to PostgreSQL notifications |
|
|
212 | (7) |
|
Installing the PostgreSQL LISTEN exchange |
|
|
213 | (2) |
|
Policy-based configuration |
|
|
215 | (2) |
|
|
217 | (1) |
|
Creating and binding a test queue |
|
|
217 | (1) |
|
|
218 | (1) |
|
10.3 Storing messages in InfluxDB |
|
|
219 | (8) |
|
InfluxDB installation and setup |
|
|
220 | (2) |
|
Installing the InfluxDB storage exchange |
|
|
222 | (1) |
|
|
223 | (1) |
|
|
224 | (3) |
|
|
227 | (1) |
Appendix: Getting Set Up |
|
228 | (9) |
Index |
|
237 | |