Goal
Subscribe multiple functions to a topic so that every published message fans out to all subscribers, with each function processing its copy independently. For help deciding between topic-based and named queues, see When to use which.Enable the Queue module
iii-config.yaml
For complete configuration options please refer to Queue module reference.
Steps
1. Register consumers for a topic
Subscribe one or more functions to the same topic. Each function gets its own internal queue.- Node / TypeScript
- Python
- Rust
notify::email and audit::log are now subscribed to order.created. Every message published to that topic reaches both functions.
2. Publish events to the topic
From any function, publish a message using the builtinenqueue function. The engine fans it out to every subscribed function.
- Node / TypeScript
- Python
- Rust
3. Understand fan-out delivery
Topic-based queues use fan-out per function:- Each distinct function subscribed to a topic receives a copy of every message.
- If a function has multiple replicas running, they compete on a shared per-function queue — only one replica processes each message.
4. Filter messages with conditions (optional)
Attach a condition function to a queue trigger to filter which messages reach the handler. The condition receives the message data and returnstrue or false. If false, the handler is not called — no error is surfaced.
- Node / TypeScript
- Python
- Rust
See Conditions for the full pattern including HTTP and state trigger conditions.
Result
Every function subscribed to a topic receives a copy of each published message. If a function has multiple replicas, they compete on a shared per-function queue — only one replica processes each message. The producer only knows the topic name; it does not need to know which functions are subscribed.Real-World Scenario
Event Fan-Out with Topic Queues
An order system publishesorder.created events. Multiple independent services — email notifications, inventory updates, and analytics — each need to process every order. Topic-based queues fan out each message to all subscribers with independent retries per function.
- Node / TypeScript
- Python
- Rust
order.created event independently. If inventory::reserve fails and retries, it does not affect notify::email or analytics::track.
For adapter options (builtin, RabbitMQ, Redis), scenario-based recommendations, and the full queue configuration reference, see the Queue module reference.
Remember
Producers publish to a topic and return immediately. The engine fans out each message to every subscribed function, with independent retries per function. If a function has multiple replicas, they compete on a shared per-function queue — only one replica processes each message.Next Steps
Named Queues
Enqueue jobs to specific functions with retries, FIFO ordering, and concurrency control
Dead Letter Queues
Handle and redrive failed queue messages
Queue Module Reference
Full configuration reference for queues and adapters
Conditions
Filter queue messages with condition functions