Queues
The queue sits between the producer (extraction) and the consumer (loading) in the thread and process runners. The stream runner doesn’t use one.
Why Queues?
Section titled “Why Queues?”Queues provide a buffer between extraction and loading:
- Decoupling: Sources and destinations work independently
- Throughput: Extraction continues while the destination loads the previous batch
- Backpressure: The producer pauses when the queue is full
Python Queue
Section titled “Python Queue”python_queue is the default and the only supported queue. It needs no external service.
engine: queue: type: python_queue config: max_nb_messages: 1000000 max_bytes: 536870912 queue: max_size: 0 consumer: poll_interval: 1| Field | Default | Description |
|---|---|---|
config.max_nb_messages | 1000000 | Maximum number of messages in the queue |
config.max_bytes | unset | Pause the producer once the queued iterations take about this many bytes in memory |
config.queue.max_size | 0 | Maximum queue size. 0 means unlimited |
config.consumer.poll_interval | 1 | Seconds between consumer polls |
max_bytes bounds memory rather than message count. The size is estimated from the average size of the iterations produced so far, so set it when a source returns large pages.
- In-memory only: queued messages are lost if the process dies, and the run resumes from the last checkpoint
- Producer and consumer run in the same process (thread runner) or in two worker processes (process runner)
RabbitMQ and Kafka Queue Adapters
Section titled “RabbitMQ and Kafka Queue Adapters”Scaling Beyond One Process
Section titled “Scaling Beyond One Process”Durability comes from checkpointing, not from the queue, so an external broker isn’t needed for reliability. To scale:
- Tune the buffer: raise the destination’s
buffer_sizeand setmax_bytesto bound memory - Split the work: run one pipeline per stream, each with its own config and job
- Stream from Kafka: for continuous ingestion, read Kafka with the stream runner, or use bizon-rs, a native Rust worker for Kafka to
bigquery_streaming_v2stream pipelines
Next Steps
Section titled “Next Steps”- See the Engine Reference for queue, backend and runner options
- Learn about Architecture for the full picture