---
title: "Produce and consume"
description: "The smallest complete Queen program: create a queue, push messages, consume them with a consumer group, acknowledge them, and verify each arrived exactly once."
---

> Documentation Index
> Fetch the complete documentation index at: https://queenmq.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Produce and consume

Start here. This program does the four things every Queen application does, and nothing else: it
creates a queue, pushes a handful of messages, consumes them under a consumer group, and
acknowledges them.

Two things in it are worth pausing on. The queue and its partition are created by the first push,
so there is nothing to provision beforehand. And the acknowledgement is a commit of a position,
not a receipt for one message: when the program acknowledges the last message of a batch, every
message before it in that partition is complete for that group too.

### JavaScript

### Python

### Go

## What to take away

The consumer group is what makes the read repeatable. Point a second group at the same queue and
it gets its own cursor and its own copy of every message, without the producer knowing or the
first group slowing down.

Next: [ordering and deduplication](/full-examples/ordering-and-dedup), which is why most people
choose Queen in the first place.

Source: https://queenmq.com/full-examples/produce-consume/index.mdx
