Skip to content

LAB 11 ‐ Topic & Notification

DevWithNehaCloud edited this page Apr 23, 2026 · 4 revisions

In OCI, Topics and Notifications are the core components of the OCI Notifications Service (ONS). They work together to implement a Pub/Sub (Publish/Subscribe) architecture, which is a modern way for different cloud services to communicate without being directly connected to each other.

📌 What is a Topic?

A Topic is a communication channel used to send messages to multiple users or systems.

  • It acts like a group
  • You publish a message once → it goes to all subscribers

🧠 Simple Definition

A Topic is a central place where messages are sent and distributed to all subscribed endpoints.


📩 What is a Notification?

A Notification is the actual message/alert sent to users through a topic.

  • Triggered by events (like alarms, failures, etc.)
  • Delivered via Email, SMS, or other endpoints

🧠 Simple Definition

A Notification is an alert message sent to users when something happens.


🔗 How Topic & Notification Work Together

  1. Create a Topic
  2. Add Subscriptions (Email, SMS, etc.)
  3. A service (like Monitoring Alarm) sends a message to the topic
  4. The topic delivers notifications to all subscribers

⚙️ Real-Time Example (CPU Alert 🚨)

Scenario:

You want to get notified when CPU usage is high.

Steps:

  1. Create a Topic
    👉 Name: High-CPU-Alert
  2. Add Subscription
    👉 Email: admin@example.com
  3. Create Alarm in Monitoring
    👉 Condition: CPU > 80%
  4. When CPU exceeds 80%:
    • Alarm triggers
    • Message sent to Topic
    • Topic sends Notification (Email) to admin

🔄 Flow Diagram (Text)

Compute Instance (CPU High)
↓
Monitoring Alarm Triggered
↓
Topic (High-CPU-Alert)
↓
Notification (Email/SMS)
↓
Admin/User

🧾 🔑 Key Differences: Topic vs Notification

Feature Topic Notification
Purpose Channel / Group Message / Alert
Role Holds subscribers Delivers information
Example High-CPU-Alert "CPU usage is above 80%"

🧠 Easy Analogy

  • Topic = WhatsApp Group
  • Notification = Message sent in that group

✅ Short Definition

In OCI, a Topic is a communication channel used to send messages to multiple subscribers, while a Notification is the actual alert message delivered to those subscribers.

Steps to create Topic and Subscriptions

  1. Select burger menu

  2. Navigate to Developer Services and click on "Notifications"

image
  1. select the compartment where instance is created, then click on create topic.
image

4.Enter name, description and select root compartment then click on create.

image

5.To create the subscription click on subscription option

image

6.click on create subscription

image

7.In configure subscription, inside protocol select Email from drop down and provide the valid email to get the notification and click on create

image image image image

Clone this wiki locally