Skip to content

Commit 97629a7

Browse files
Updare RabbitMQ GCP and Azure content based on testing and feedback
1 parent 746c196 commit 97629a7

6 files changed

Lines changed: 88 additions & 72 deletions

File tree

content/learning-paths/servers-and-cloud-computing/rabbitmq-gcp/azure_baseline.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
---
2-
title: RabbitMQ Baseline Testing
2+
title: Validate RabbitMQ on Azure
33
weight: 5
44

55
### FIXED, DO NOT MODIFY
66
layout: learningpathall
77
---
88

9-
## Run a Baseline Test With RabbitMQ
10-
This section validates a working **RabbitMQ 4.2.0** installation with **Erlang OTP 26** on an **Azure Ubuntu Arm64 VM**.
9+
## Run a baseline test with RabbitMQ
10+
This section shows you how to validate a working RabbitMQ 4.2.0 installation with Erlang OTP 26 on an Azure Ubuntu Arm64 VM.
1111

12-
All steps are **CLI-only** and suitable for baseline verification.
12+
All steps use the command line and are suitable for baseline verification.
1313

14-
### Verify RabbitMQ Service Status
14+
## Verify RabbitMQ service status
1515

1616
```console
1717
sudo systemctl status rabbitmq

content/learning-paths/servers-and-cloud-computing/rabbitmq-gcp/azure_installation.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Install RabbitMQ on Microsoft Azure Cobalt 100
2+
title: Install RabbitMQ on Azure Cobalt 100
33
weight: 4
44

55
### FIXED, DO NOT MODIFY
@@ -53,7 +53,8 @@ echo 'export PATH=$ERLANG_HOME/bin:$PATH' | sudo tee -a /etc/profile.d/erlang.sh
5353
```
5454

5555
### Download and install RabbitMQ
56-
This section downloads the official RabbitMQ 4.2.0 generic Unix distribution and installs it under `/opt/rabbitmq`.
56+
57+
Download the official RabbitMQ 4.2.0 generic Unix distribution and install it under `/opt/rabbitmq`.
5758

5859
```console
5960
cd ~
@@ -66,17 +67,19 @@ sudo mkdir -p /var/lib/rabbitmq /var/log/rabbitmq
6667
sudo chown -R $USER:$USER /var/lib/rabbitmq /var/log/rabbitmq
6768
```
6869

69-
#### Update PATH environment variable
70-
This step makes RabbitMQ CLI tools available in the current shell and should be persisted for future sessions.
70+
## Update PATH environment variable
71+
72+
Make RabbitMQ CLI tools available in the current shell. Add this to `~/.bashrc` or `~/.profile` for persistence across sessions.
7173

7274
```console
7375
export PATH=/usr/local/erlang-26/bin:/opt/rabbitmq/sbin:$PATH
7476
```
7577

7678
Add this line to `~/.bashrc` or `~/.profile` for persistence.
7779

78-
### Configure RabbitMQ systemd service
79-
This section configures RabbitMQ to run as a managed systemd service, enabling automatic startup and controlled lifecycle management.
80+
## Configure RabbitMQ systemd service
81+
82+
Configure RabbitMQ to run as a managed systemd service, enabling automatic startup and controlled lifecycle management.
8083

8184
Create `/etc/systemd/system/rabbitmq.service`:
8285

content/learning-paths/servers-and-cloud-computing/rabbitmq-gcp/azure_instance.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Creating a virtual machine based on Azure Cobalt 100 is no different from creati
3939

4040
![Azure portal VM creation — Azure Cobalt 100 Arm64 virtual machine (D4ps_v6) alt-text#center](images/instance4.png "Figure 4: Download Private key and Create Resources")
4141

42-
11. Your virtual machine should be ready and running within no time. You can SSH into the virtual machine using the private key, along with the Public IP details.
42+
Your virtual machine deploys within a few minutes. SSH into the virtual machine using the downloaded private key and the public IP address.
4343

4444
![Azure portal VM creation — Azure Cobalt 100 Arm64 virtual machine (D4ps_v6) alt-text#center](images/final-vm.png "Figure 5: VM deployment confirmation in Azure portal")
4545

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Create a Google Axion C4A Arm virtual machine on GCP
2+
title: Create a Google Axion C4A virtual machine
33
weight: 7
44

55
### FIXED, DO NOT MODIFY
@@ -8,8 +8,7 @@ layout: learningpathall
88

99
## Overview
1010

11-
In this section, you provision a Google Axion C4A Arm virtual machine on Google Cloud Platform (GCP) using the `c4a-standard-4` (4 vCPUs, 16 GB memory) machine type in the Google Cloud Console.
12-
We will then use this GCP VM to execute a few RabbitMQ use cases.
11+
In this section, you'll provision a Google Axion C4A Arm virtual machine on Google Cloud Platform (GCP) using the `c4a-standard-4` (4 vCPUs, 16 GB memory) machine type in the Google Cloud Console. You will then use this GCP VM to execute a few RabbitMQ use cases.
1312

1413
{{% notice Note %}}
1514
For support on GCP setup, see the Learning Path [Getting started with Google Cloud Platform](/learning-paths/servers-and-cloud-computing/csp/google/).
@@ -23,18 +22,16 @@ Under **Machine configuration**, populate fields such as **Instance name**, **Re
2322

2423
![Create a Google Axion C4A Arm virtual machine in the Google Cloud Console with c4a-standard-4 selected alt-text#center](images/gcp-vm.png "Creating a Google Axion C4A Arm virtual machine in Google Cloud Console")
2524

26-
Under **OS and Storage**, select **Change**, then choose an Arm64-based OS image. For this Learning Path, use **SUSE Linux Enterprise Server**. Select "Pay As You Go" for the license type and press **Select**.
25+
Under **OS and Storage**, select **Change**, then choose an Arm64-based OS image. For this Learning Path, use **SUSE Linux Enterprise Server**. Select **Pay As You Go** for the license type and select **Select**.
2726

2827
Under **Networking**, enable **Allow HTTP traffic** and add "allow-tcp-15672" as a network tag in the **Network tags** text field.
2928

3029
![Adding the TCP/15672 firewall rule to the VM](images/network-config.png "Adding the TCP/15672 firewall rule to the VM")
3130

32-
Select **Create** to launch the instance. Once created, you see an **SSH** option and the public IP address for your VM in the list of VM instances. Save the public IP address as you need it in the next step. Select the **SSH** option to launch an SSH shell into your VM instance.
31+
Select **Create** to launch the instance. After the instance is created, the **SSH** option and public IP address appear in the VM instances list. Save the public IP address for later use. Select the **SSH** option to open an SSH shell to your VM instance.
3332

3433
![Invoke an SSH session via your browser alt-text#center](images/gcp-pubip-ssh.png "Invoke an SSH session into your running VM instance")
3534

36-
A window opens from your browser and you see a shell into your VM instance.
35+
A browser window opens with a shell session to your VM instance.
3736

3837
![Terminal Shell in your VM instance alt-text#center](images/gcp-shell.png "Terminal shell in your VM instance")
39-
40-
Next, install RabbitMQ.

content/learning-paths/servers-and-cloud-computing/rabbitmq-gcp/gcp_use_case1.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: RabbitMQ Use Case 1 – Event Processing with Python Workers
2+
title: Implement event processing with Python workers
33
weight: 10
44

55
### FIXED, DO NOT MODIFY

content/learning-paths/servers-and-cloud-computing/rabbitmq-gcp/gcp_use_case2.md

Lines changed: 67 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,25 @@ weight: 11
66
layout: learningpathall
77
---
88

9+
## Overview
910

10-
## WhatsApp Notification Use Case using RabbitMQ
11-
This document demonstrates a **real-world asynchronous messaging use case** where RabbitMQ is used to process WhatsApp notifications reliably using a worker-based architecture.
11+
In this section you'll implement a real-world asynchronous messaging pattern where RabbitMQ processes WhatsApp notifications reliably using a worker-based architecture.
1212

13-
### Use case overview
13+
## Why use RabbitMQ for WhatsApp notification
1414

15-
In many production systems, sending WhatsApp notifications must be:
15+
In production systems, sending WhatsApp notifications must be:
1616
- Reliable
1717
- Asynchronous
1818
- Independent of the main application flow
1919

20-
RabbitMQ is used as a **message broker** to decouple message production from message consumption.
20+
RabbitMQ acts as a message broker to decouple message production from message consumption.
2121

22-
### Architecture flow
22+
The architecture follows this flow:
2323

24-
1. Application publishes a message to RabbitMQ
25-
2. RabbitMQ routes the message to a queue
26-
3. A Python worker consumes the message
27-
4. The worker simulates sending a WhatsApp notification
24+
- Application publishes a message to RabbitMQ
25+
- RabbitMQ routes the message to a queue
26+
- A Python worker consumes the message
27+
- The worker simulates sending a WhatsApp notification
2828

2929
### Prerequisites
3030

@@ -34,34 +34,35 @@ RabbitMQ is used as a **message broker** to decouple message production from mes
3434
- Python 3.8+
3535
- `pika` Python client library installed
3636

37-
### Install Python dependencies
38-
Installs Python and the RabbitMQ Python client needed to build a consumer.
37+
## Install Python dependencies
38+
39+
Install Python and the RabbitMQ Python client needed to build a consumer.
3940

4041
```console
4142
sudo zypper install -y python3 python3-pip
4243
pip3 install pika
4344
```
4445

45-
### RabbitMQ topology
46+
## Understand the RabbitMQ topology
47+
4648
This use case uses a direct exchange topology for exact-match routing.
4749

48-
**Exchanges**
49-
- **notifications (direct):** Routes WhatsApp notification messages based on an exact routing key match.
50+
**Exchanges:**
51+
- `notifications` (direct): Routes WhatsApp notification messages based on an exact routing key match.
52+
53+
**Queue:**
54+
- `whatsapp.notifications` (durable): Stores WhatsApp messages persistently until they are consumed by a worker.
5055

51-
**Queue**
52-
- **whatsapp.notifications (durable):** Stores WhatsApp messages persistently until they are consumed by a worker.
56+
**Binding:**
57+
- Exchange: `notifications`
58+
- Routing key: `whatsapp`
59+
- Queue: `whatsapp.notifications`
5360

54-
**Binding**
55-
- Exchange: **notifications** – Connects the exchange to the WhatsApp notification queue.
56-
- Routing key: **whatsapp** – Ensures only WhatsApp-related messages are routed.
57-
- Queue: **whatsapp.notifications**– Final destination where messages are delivered for processing.
61+
This ensures only WhatsApp-related messages are routed to the final destination for processing.
5862

59-
### Declare RabbitMQ resources
60-
Creates the required exchange, queue, and binding for WhatsApp notifications.
63+
## Declare RabbitMQ resources
6164

62-
- `Declare exchange`: Creates a durable direct exchange named notifications to route messages using exact routing keys.
63-
- `Declare queue`: Creates a durable queue whatsapp.notifications to persist WhatsApp notification messages until consumed.
64-
- `Declare binding`: Links the notifications exchange to the whatsapp.notifications queue using the whatsapp routing key.
65+
Create the required exchange, queue, and binding for WhatsApp notifications.
6566

6667
```console
6768
./rabbitmqadmin declare exchange \
@@ -78,11 +79,12 @@ Creates the required exchange, queue, and binding for WhatsApp notifications.
7879
destination=whatsapp.notifications \
7980
routing_key=whatsapp
8081
```
81-
Each command confirms successful creation with messages like **exchange declared, queue declared, and binding declared**.
8282

83-
**Validate the setup:**
83+
Each command confirms successful creation.
8484

85-
Validates that RabbitMQ resources exist and are correctly connected.
85+
## Validate the setup
86+
87+
Verify that RabbitMQ resources exist and are correctly connected.
8688

8789
```console
8890
./rabbitmqadmin list queues name messages
@@ -94,14 +96,14 @@ Validates that RabbitMQ resources exist and are correctly connected.
9496
- `list exchanges` lists all exchanges and their types, allowing verification of correct exchange configuration.
9597
- `list bindings` shows how exchanges, queues, and routing keys are connected.
9698

97-
**Output shows:**
99+
The output shows you the following:
98100

99-
- notifications exchange of type direct
100-
- whatsapp.notifications durable queue
101-
- Correct routing key binding (whatsapp)
101+
- `notifications` exchange of type direct
102+
- `whatsapp.notifications` durable queue
103+
- Correct routing key binding (`whatsapp`)
102104
- Zero or more queued messages
103105

104-
Confirms topology correctness before consuming messages.
106+
This confirms topology correctness before consuming messages.
105107

106108
```output
107109
> ./rabbitmqadmin list queues name messages
@@ -142,12 +144,11 @@ Confirms topology correctness before consuming messages.
142144
+---------------+------------------------+------------------------+
143145
```
144146

145-
### WhatsApp worker implementation
146-
The worker attaches as a **blocking consumer** to the `whatsapp.notifications` queue and processes incoming messages.
147+
## Implement the WhatsApp worker
147148

148-
Create a `whatsapp_worker.py` file with the content below:
149+
Create a Python consumer (worker) that processes WhatsApp notification messages from the queue.
149150

150-
This Python script implements a **RabbitMQ consumer (worker)** that processes WhatsApp notification messages from a queue in a reliable and controlled manner.
151+
Create a file named `whatsapp_worker.py` with the following code:
151152

152153
```python
153154
import pika
@@ -202,16 +203,17 @@ print("[DEBUG] Starting consumer loop (this should block)...")
202203
channel.start_consuming()
203204
```
204205

205-
### Start the worker
206+
## Start the worker
207+
206208
Run the worker in a dedicated terminal session:
207209

208210
```console
209211
python3 whatsapp_worker.py
210212
```
211213

212-
The worker is running correctly and waiting for messages without exiting.
214+
The worker runs correctly and waits for messages without exiting.
213215

214-
**output:**
216+
The output is similar to:
215217

216218
```output
217219
[DEBUG] Connecting to RabbitMQ...
@@ -221,10 +223,11 @@ WhatsApp Worker started. Waiting for messages...
221223
[DEBUG] Starting consumer loop (this should block)...
222224
```
223225

224-
The process must block without returning to the shell prompt.
226+
The process blocks without returning to the shell prompt.
227+
228+
## Publish a test message
225229

226-
### Publish a test message
227-
From another SSH terminal: Publishes a WhatsApp notification message to RabbitMQ.
230+
Open another SSH terminal and publish a WhatsApp notification message to RabbitMQ.
228231

229232
```console
230233
./rabbitmqadmin publish \
@@ -233,16 +236,17 @@ From another SSH terminal: Publishes a WhatsApp notification message to RabbitMQ
233236
payload='{"phone":"+911234567890","message":"Hello from RabbitMQ"}'
234237
```
235238

236-
You should see the following output from whatsapp_worker.py that is running in the first SSH terminal:
239+
The output appears in the first terminal running `whatsapp_worker.py`:
237240

238241
```output
239242
[Worker] Sending WhatsApp message to +911234567890
240243
[Worker] Message content: Hello from RabbitMQ
241244
[Worker] Message sent successfully
242245
```
243246

244-
### Message consumption validation
245-
The worker terminal displays logs similar to:
247+
## Validate message consumption
248+
249+
The worker terminal displays the complete log:
246250

247251
```output
248252
[DEBUG] Connecting to RabbitMQ...
@@ -254,21 +258,22 @@ WhatsApp Worker started. Waiting for messages...
254258
[Worker] Message content: Hello from RabbitMQ
255259
[Worker] Message sent successfully
256260
```
257-
**What this confirms:**
261+
262+
This confirms:
258263

259264
- Message routing works correctly
260265
- Queue consumption is successful
261266
- Manual acknowledgments are applied
262267

263268
This validates the end-to-end message flow.
264269

265-
### Verify queue state
270+
## Verify queue state
266271

267272
```console
268273
./rabbitmqadmin list queues name messages consumers
269274
```
270275

271-
Expected output is similar to:
276+
The output is similar to:
272277

273278
```output
274279
+------------------------+----------+-----------+
@@ -281,8 +286,19 @@ Expected output is similar to:
281286
+------------------------+----------+-----------+
282287
```
283288

284-
This confirms that:
289+
This confirms:
285290

286291
- Messages were consumed successfully
287292
- One active consumer is connected
288293
- No backlog remains in the queue
294+
295+
## What you've accomplished
296+
297+
In this use case, you:
298+
- Configured a direct exchange topology for exact-match routing
299+
- Created durable queues and bindings for WhatsApp notifications
300+
- Implemented a Python worker using the `pika` library
301+
- Published test messages and validated end-to-end message flow
302+
- Confirmed reliable message consumption with manual acknowledgments
303+
304+
This pattern demonstrates how RabbitMQ enables asynchronous, decoupled communication for notification systems on Arm-based cloud platforms.

0 commit comments

Comments
 (0)