---
title: "ezgh queues receive"
description: "Receive messages, with their receipt handles."
---

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

# ezgh queues receive

{/* Generated by ezgh-cli's internal/tools/clidocs from the ezgh command tree. Don't edit: change the command's help in ezgh-cli and regenerate. */}

```sh
ezgh queues receive <queue> [--max n] [--wait t] [--visibility-timeout t] [--ack] [flags]
```

Receive up to `--max` messages (1 to 10), waiting up to `--wait` (0 to 20s; default: the queue's receive wait) for one to arrive. Each is printed with its receipt handle, and stays hidden from other receivers for `--visibility-timeout` (default: the queue's).

Handle a message, then acknowledge it (`ezgh queues ack <handle>`) so it isn't received again, or release it now (`ezgh queues change-visibility <handle> 0`). `--ack` acknowledges every message received once it's printed: use it when printing is all the handling there is. Nothing received prints nothing (an empty list for -o json and yaml).

Part of [`ezgh queues`](/cli/reference/queues).

## Examples

```sh
ezgh queues receive orders --max 10 --wait 20s
ezgh queues receive orders --ack -o json
```

## Flags

| Flag | Type | Default | Description |
| --- | --- | --- | --- |
| `--ack` | boolean |  | acknowledge (delete) the messages once they're printed |
| `--max` | int | `1` | the most messages to receive, 1 to 10 |
| `--visibility-timeout` | string |  | hide the messages from other receivers this long, 0 to 12h (default: the queue's) |
| `--wait` | string |  | wait up to this long for a message, 0 to 20s (default: the queue's receive wait) |

This command also takes the [global flags](/cli/reference#global-flags).

Source: https://docs.ezghcloud.com/cli/reference/queues-receive/index.mdx
