You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/learning-paths/servers-and-cloud-computing/rabbitmq-gcp/azure_instance.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -39,7 +39,7 @@ Creating a virtual machine based on Azure Cobalt 100 is no different from creati
39
39
40
40

41
41
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.
43
43
44
44

title: Create a Google Axion C4A Arm virtual machine on GCP
2
+
title: Create a Google Axion C4A virtual machine
3
3
weight: 7
4
4
5
5
### FIXED, DO NOT MODIFY
@@ -8,8 +8,7 @@ layout: learningpathall
8
8
9
9
## Overview
10
10
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.
13
12
14
13
{{% notice Note %}}
15
14
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
23
22
24
23

25
24
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**.
27
26
28
27
Under **Networking**, enable **Allow HTTP traffic** and add "allow-tcp-15672" as a network tag in the **Network tags** text field.
29
28
30
29

31
30
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.
33
32
34
33

35
34
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.
37
36
38
37

Copy file name to clipboardExpand all lines: content/learning-paths/servers-and-cloud-computing/rabbitmq-gcp/gcp_use_case2.md
+67-51Lines changed: 67 additions & 51 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,25 +6,25 @@ weight: 11
6
6
layout: learningpathall
7
7
---
8
8
9
+
## Overview
9
10
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.
12
12
13
-
### Use case overview
13
+
##Why use RabbitMQ for WhatsApp notification
14
14
15
-
In many production systems, sending WhatsApp notifications must be:
15
+
In production systems, sending WhatsApp notifications must be:
16
16
- Reliable
17
17
- Asynchronous
18
18
- Independent of the main application flow
19
19
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.
21
21
22
-
### Architecture flow
22
+
The architecture follows this flow:
23
23
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
28
28
29
29
### Prerequisites
30
30
@@ -34,34 +34,35 @@ RabbitMQ is used as a **message broker** to decouple message production from mes
34
34
- Python 3.8+
35
35
-`pika` Python client library installed
36
36
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.
39
40
40
41
```console
41
42
sudo zypper install -y python3 python3-pip
42
43
pip3 install pika
43
44
```
44
45
45
-
### RabbitMQ topology
46
+
## Understand the RabbitMQ topology
47
+
46
48
This use case uses a direct exchange topology for exact-match routing.
47
49
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.
50
55
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`
53
60
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.
58
62
59
-
### Declare RabbitMQ resources
60
-
Creates the required exchange, queue, and binding for WhatsApp notifications.
63
+
## Declare RabbitMQ resources
61
64
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.
65
66
66
67
```console
67
68
./rabbitmqadmin declare exchange \
@@ -78,11 +79,12 @@ Creates the required exchange, queue, and binding for WhatsApp notifications.
78
79
destination=whatsapp.notifications \
79
80
routing_key=whatsapp
80
81
```
81
-
Each command confirms successful creation with messages like **exchange declared, queue declared, and binding declared**.
82
82
83
-
**Validate the setup:**
83
+
Each command confirms successful creation.
84
84
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.
86
88
87
89
```console
88
90
./rabbitmqadmin list queues name messages
@@ -94,14 +96,14 @@ Validates that RabbitMQ resources exist and are correctly connected.
94
96
-`list exchanges` lists all exchanges and their types, allowing verification of correct exchange configuration.
95
97
-`list bindings` shows how exchanges, queues, and routing keys are connected.
96
98
97
-
**Output shows:**
99
+
The output shows you the following:
98
100
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`)
102
104
- Zero or more queued messages
103
105
104
-
Confirms topology correctness before consuming messages.
106
+
This confirms topology correctness before consuming messages.
105
107
106
108
```output
107
109
> ./rabbitmqadmin list queues name messages
@@ -142,12 +144,11 @@ Confirms topology correctness before consuming messages.
The worker attaches as a **blocking consumer** to the `whatsapp.notifications` queue and processes incoming messages.
147
+
## Implement the WhatsApp worker
147
148
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.
149
150
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:
0 commit comments