# Message Queue

> A mechanism that holds messages durably until a consumer takes and acknowledges each one.

Record: `architecture:message-queue`
Kind: mechanism
Layer: [Execution Core](https://banes-lab.com/records/layer/execution-core.md)
Severity: contextual
Scope: integration, async processing
Canonical: https://banes-lab.com/ontology#architecture-message-queue

Listed in [Architecture principles](https://banes-lab.com/api/records/architecture.md), after [Publish/Subscribe Pattern](https://banes-lab.com/records/architecture/publish-subscribe-pattern.md) and before [Message Broker](https://banes-lab.com/records/architecture/message-broker.md).

## Repair

- Refactored by: Introduce Queue, Add Worker
- Detected by: synchronous blocking chains for async work
- Violated by: unbounded in-memory work queues
- Measured by: queue depth, retry/dead-letter rates
- Enforced by: infrastructure policy, load tests

## Requires

- [Message Contract](https://banes-lab.com/records/lexicon/message-contract.md)
- [Consumer](https://banes-lab.com/records/lexicon/consumer.md)

## Reinforces

- [Resilience](https://banes-lab.com/records/architecture/resilience.md)
- [Backpressure](https://banes-lab.com/records/architecture/backpressure.md)

## Enables

- [Asynchronous Processing](https://banes-lab.com/records/lexicon/asynchronous-processing.md)

## Conflicts with

- [In-Memory Direct Invocation](https://banes-lab.com/records/lexicon/in-memory-direct-invocation.md)

## In tension with

- [Latency](https://banes-lab.com/records/architecture/latency.md)

## Tensions

- [Message Queue / Latency](https://banes-lab.com/records/tension/latency-message-queue.md)

## Severity

- [contextual](https://banes-lab.com/records/vocabulary/severity-contextual.md)

## Category

- [Event / Messaging / Asynchronous Architecture](https://banes-lab.com/records/architecture-category/event-messaging-asynchronous-architecture.md)

## Required by

- [Dead-Letter Queue](https://banes-lab.com/records/architecture/dead-letter-queue.md)
- [Competing Consumers](https://banes-lab.com/records/architecture/competing-consumers.md)

## Linked from

- [The board and the venue](https://banes-lab.com/disciplined-methodology/collaborate/the-board-and-the-venue.md)
- [Event / Messaging / Asynchronous Architecture](https://banes-lab.com/ontology/principles/architecture-category-event-messaging-asynchronous-architecture.md)
- [Error Handling / Resilience](https://banes-lab.com/ontology/principles/architecture-category-error-handling-resilience.md)
- [Scalability / Performance / Optimization](https://banes-lab.com/ontology/principles/architecture-category-scalability-performance-optimization.md)
- [Core Vocabulary](https://banes-lab.com/ontology/lexicon/lexicon-category-core-vocabulary.md)
- [Event Messaging Async](https://banes-lab.com/ontology/lexicon/lexicon-category-event-messaging-async.md)
- [Severity levels](https://banes-lab.com/ontology/schema/the-vocabulary-severity.md)
- [The resolutions](https://banes-lab.com/ontology/schema/the-resolutions.md)
