Batching Messages
Using processors is great for many tasks, but sometimes you will need another layer of stages. Your business logic in handle_message/3 could become a bottleneck and slow down the pipeline, especially under heavy workloads. You may also want to improve efficiency by grouping and running some operations together. This is where batching comes in to help.
Using batching in Broadway is an easy way to add another step in your data-ingestion pipeline for further processing. It allows you to leverage concurrency, and group relevant messages together to perform operations in bulk. In this section, we’re going to configure batching for BookingsPipeline to improve how tickets are being created. Rather than inserting tickets in the database ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access