<commit_before><!--
Copyright (c) 2007-2022 VMware, Inc. or its affiliates.

All rights reserved. This program and the accompanying materials
are made available under the terms of the under the Apache License,
Version 2.0 (the "License”); you may not use this file except in compliance
with the License. You may obtain a copy of the License at

https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

# Queues NOSYNTAX

## Introduction

This guide provides an overview of queues in RabbitMQ. Since
many features in a messaging system are related to queues, it
is not meant to be an exhaustive guide but rather an overview
that provides links to other guides.

This guide covers queues primarily in the context of [AMQP 0-9-1](/tutorials/amqp-concepts.html),
however, much of the content is applicable to other supported protocols.

Some protocols (e.g. STOMP and MQTT) are based around the idea of topics.
For them, queues act as data accumulation buffer for consumers.
However, it is still important to understand the role queues play
because many features still operate at the queue level, even for those protocols.

[Streams](streams.html) is an alternative messaging data structure available in RabbitMQ.
Streams provide different features from queues.

## <a id="basics" class="anchor" href="#basics">The Basics</a>

A [queue](https://en.wikipedia.org/wiki/Queue_(abstract_data_type)) is a sequential data structure
with two primary operations: an item can be **enqueued** (added) at the tail and **dequeued** (consumed)
from the head. Queues play a prominent role in the messaging technology space:
many messaging protocols and tools assume that [publishers](/publishers.html) and [consumers](/consumers.html)
communicate using a queue-like storage mechanism.

Queues in RabbitMQ are [FIFO ("first in, first out")](https://en.wikipedia.org/wiki/FIFO_(computing_and_electronics)).<commit_msg>Queues guide: add a ToC<commit_after><!--
Copyright (c) 2007-2022 VMware, Inc. or its affiliates.

All rights reserved. This program and the accompanying materials
are made available under the terms of the under the Apache License,
Version 2.0 (the "License”); you may not use this file except in compliance
with the License. You may obtain a copy of the License at

https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

# Queues NOSYNTAX

## Introduction

This guide provides an overview of queues in RabbitMQ. Since
many features in a messaging system are related to queues, it
is not meant to be an exhaustive guide but rather an overview
that provides links to other guides.

This guide covers queues primarily in the context of [AMQP 0-9-1](/tutorials/amqp-concepts.html),
however, much of the content is applicable to other supported protocols.

Some protocols (e.g. STOMP and MQTT) are based around the idea of topics.
For them, queues act as data accumulation buffer for consumers.
However, it is still important to understand the role queues play
because many features still operate at the queue level, even for those protocols.

[Streams](streams.html) is an alternative messaging data structure available in RabbitMQ.
Streams provide different features from queues.

Some key topics covered in this guide are

 * [Queue basics](#basics)
 * [Queue names](#names)
 * [Queue properties](#properties)
 * [Message ordering](#message-ordering) in a queue
 * [Queue durability](#durability) and how it relates to message persistence
 * [Replicated queue types](#distributed)
 * [Temporary](#temporary-queues) and [exclusive](#exclusive-queues) queues
 * [Runtime resource](#runtime-characteristics) usage by queue replicas
 * [Queue metrics](#metrics)
 * [TTL](#ttl-and-limits) and length limits
 * [Priority queues](#priorities)

For topics related to consumers, see the [Consumers guide](consumers.html). [Quorum queues](quorum-queues.html)
and [streams](streams.html) also have dedicated guides.

## <a id="basics" class="anchor" href="#basics">The Basics</a>

A [queue](https://en.wikipedia.org/wiki/Queue_(abstract_data_type)) is a sequential data structure
with two primary operations: an item can be **enqueued** (added) at the tail and **dequeued** (consumed)
from the head. Queues play a prominent role in the messaging technology space:
many messaging protocols and tools assume that [publishers](/publishers.html) and [consumers](/consumers.html)
communicate using a queue-like storage mechanism.

Queues in RabbitMQ are [FIFO ("first in, first out")](https://en.wikipedia.org/wiki/FIFO_(computing_and_electronics)).
{'fraction_non_alphanumeric': 0.07933723196881091, 'fraction_numerical': 0.005847953216374269, 'mean_word_length': 5.0650118203309695, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 6, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1014700', 'n_tokens_mistral': 1421, 'n_tokens_neox': 1333, 'n_words': 661}