Skip to content

nickTinMicrosoft/rti_streaming_examples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RTI Streaming Examples

Python simulators that stream real-time data to Azure Event Hub and Azure IoT Hub for ingestion into Microsoft Fabric Real-Time Intelligence (RTI).

Use these apps to demo Fabric Eventstreams, KQL databases, real-time dashboards, and Data Agents — no real hardware or data sources required.


Simulators

Folder Description Target
hospital/ Patient vitals + movement events for 15 simulated patients Event Hub
trains/ NYC metro train telemetry (3 lines, GPS, speed, delays) Event Hub or IoT Hub
flight-tracker/ Live ADS-B aircraft data from a PiAware receiver Event Hub
water-quality/ Water quality monitoring (18 sensor sites, pH, turbidity, chlorine, anomaly alerts) Event Hub
water-waste/ Water waste/NRW monitoring (12 DMAs, flow balance, pressure, leak detection) Event Hub

Quick Start

1. Set Up Azure Resources

Follow the setup guides to create the necessary Azure resources:

  • 📘 Set up Event Hubs — Create an Event Hubs namespace, individual hubs, and SAS policies
  • 📗 Set up IoT Hub — Create an IoT Hub and register devices (only needed for the IoT Hub train simulator)

2. Configure Environment

# Clone the repo
git clone https://github.com/nickTinMicrosoft/rti_streaming_examples.git
cd rti_streaming_examples

# Create your .env file from the template
cp .env.example .env

# Edit .env and paste in your connection strings

3. Run a Simulator

# Example: Hospital vitals
cd hospital
pip install -r requirements.txt
python hospital_vitals.py

Each simulator folder has its own README.md with full setup details.


Architecture

┌───────────────────────┐     ┌──────────────────┐     ┌────────────────────┐
│  Python Simulators    │     │  Azure           │     │  Microsoft Fabric  │
│                       │     │                  │     │                    │
│  hospital_vitals.py  ─┼────▶│  Event Hub      ─┼────▶│  Eventstream       │
│  hospital_movement.py─┼────▶│                  │     │       │            │
│  trains_eventhub.py  ─┼────▶│                  │     │       ▼            │
│  flight_tracker.py   ─┼────▶│                  │     │  KQL Database      │
│                       │     │                  │     │       │            │
│  trains_iothub.py    ─┼────▶│  IoT Hub ────────┼────▶│       ▼            │
└───────────────────────┘     └──────────────────┘     │  Real-Time         │
                                                       │  Dashboard / Agent │
                                                       └────────────────────┘

Environment Variables

All scripts load secrets from a .env file in the project root. See .env.example for the full list.

Variable Used By Required
EVENTHUB_VITALS_CONN_STR Hospital vitals Yes (for hospital)
EVENTHUB_MOVEMENT_CONN_STR Hospital movement Yes (for hospital)
EVENTHUB_TRAIN_CONN_STR Trains (Event Hub) Yes (for EH trains)
IOT_RED_LINE_CONN_STR Trains (IoT Hub) Yes (for IoT trains)
IOT_BLUE_LINE_CONN_STR Trains (IoT Hub) Yes (for IoT trains)
IOT_GREEN_LINE_CONN_STR Trains (IoT Hub) Yes (for IoT trains)
EVENTHUB_FLIGHT_CONN_STR Flight tracker Yes (for flights)
EVENTHUB_WATER_CONN_STR Water quality Yes (for water-quality)
EVENTHUB_WATER_NAME Water quality Yes (for water-quality)
EVENTHUB_WASTE_CONN_STR Water waste/NRW Yes (for water-waste)
EVENTHUB_WASTE_NAME Water waste/NRW Yes (for water-waste)

⚠️ Never commit your .env file. It is gitignored by default.


Requirements

  • Python 3.10+
  • An Azure subscription
  • A Microsoft Fabric workspace (for the Eventstream destination)

License

MIT

About

Python simulators that stream real-time data to Azure Event Hub and IoT Hub for Microsoft Fabric RTI demos

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages