The Streaming module provides standalone real-time data processing with Kafka/Redpanda topics. You can use this capability independently to build event-driven architectures, data transformations, and real-time pipelines without requiring other MooseStack components.
Ensure your Stream is correctly imported into your main.py file.
Example (TypeScript equivalent): export { exampleStream }
Learn more about export pattern: local development / hosted.
from moose_lib import Streamfrom pydantic import BaseModelfrom datetime import datetime class ExampleEvent(BaseModel): id: str user_id: str timestamp: datetime event_type: str # Create a standalone stream for user eventsexample_stream = Stream[ExampleEvent]("streaming-topic-name") # Add consumers for real-time processingdef process_event(event: ExampleEvent): print(f"Processing event: {event}") # Custom processing logic here example_stream.add_consumer(process_event) # No export needed - Python modules are automatically discoveredTo enable streaming, you need to ensure that the streaming_engine feature flag is set to true in your moose.config.toml file:
[features]streaming_engine = trueThe Streaming capability can be used independently, or in conjunction with other MooseStack modules: