DOCS / GUIDES

Event-driven architectures with FeedQueue

Decouple services with queues, topics, and a healthy respect for ordering.

Advanced16 min read
Before you beginYou need the cluck CLI, a Pollosoft account, and a coop to work in. This guide assumes you are comfortable with the basics. If you are not, start with Getting started.

Overview

Decouple services with queues, topics, and a healthy respect for ordering. The whole thing takes about 16 minutes, and the commands below are the ones you will use along the way.

$ cluck feed queue create orders
$ cluck feed queue subscribe orders --to worker
$ cluck feed queue stats orders

Steps

  1. Choose queues or topics. Use a queue when one consumer should handle each message, and a topic when many should.
  2. Handle duplicates. Delivery is at-least-once, so make handlers idempotent. Use the message ID as a key.
  3. Dead letters. After five failures, a message moves to the dead-letter queue. Review it daily and fix the cause.
  4. Scale consumers. Add workers until the backlog drains. Autoscaling on queue depth keeps your hens fed.

Commands used

Keep going

Stuck? Check the error codes, the FAQ, or the glossary.