Simplifying Event-Driven Services with FastStream: A How-To Guide
summary
FastStream is an open‑source Python framework that wires Pydantic models to async brokers so handlers are called on incoming messages and return values are published automatically; it uses Pydantic for parsing, aio-kafka for Kafka I/O and emits AsyncAPI docs. Demo app consumes names and produces greetings via Kafka, tests run against an in‑memory test broker (one example test passes), supports partition keys, batched consume/publish, SSL/SASL security abstractions, FastAPI routing, CLI run with multi‑worker (CPU‑bound) orchestration.
AI-written summary · about
chapters (22)
- 0:00Introduction
- 1:45Motivation for FastStream
- 5:19Design goals
- 8:30Merging FastKafka and Propan
- 9:34Core architecture and broker setup
- 12:23Custom message encoding
- 13:26Handling Kafka partitions
- 14:34Batch processing
- 15:36Security configuration
- 17:52Local testing
- 20:26Switching between Kafka and RabbitMQ
- 21:49AsyncAPI documentation
- 23:38Sample application
- 26:38Q&A batch handling
- 27:00Project structure
- 30:03Running the application with Docker
- 34:10CI/CD setup
- 36:00AsyncAPI deployment
- 38:08Writing tests
- 41:19FastStream with FastAPI
- 47:06Q&A deployment and stateful functions
- 49:37Closing
related talks
27mReal-time Event Streaming with Python
46mAsyncAPI + Spring Cloud Stream = Event-Driven Microservices Made Easy
20mAPI Management for Event-Driven Microservices
43mEvent Streams & Data Rapids: Harnessing the Full Power of Messaging Platforms.
18mBridging the Gap: Real-Time Predictive Analytics with Faustream
36mStream All The Things!
58mGame of Streams
29mIntroduction to FastAPI
