> For the complete documentation index, see [llms.txt](https://docs.vernemq.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.vernemq.com/1.8.0/administration/retained-store.md).

# Retained messages

To list the retained messages simply invoke `vmq-admin retain show`:

```
$ vmq-admin retain show
+------------------+----------------+
|     payload      |     topic      |
+------------------+----------------+
| a-third-message  | a/third/topic  |
|some-other-message|some/other/topic|
|    a-message     |   some/topic   |
|    a-message     | another/topic  |
+------------------+----------------+
```

{% hint style="success" %}
Note, by default a maximum of 100 results are returned. This is a mechanism to protect the from overload as there can be millions of retained messages. Use `--limit=<RowLimit>` to override the default value.
{% endhint %}

Besides listing the retained messages it is also possible to filter them:

```
$ vmq-admin retain show --payload --topic=some/topic
+---------+
| payload |
+---------+
|a-message|
+---------+
```

In the above example we list only the payload for the topic `some/topic`.

Another example where all topics are list with retained messages with a specific payload:

```
$ vmq-admin retain show --payload a-message --topic
+-------------+
|    topic    |
+-------------+
| some/topic  |
|another/topic|
+-------------+
```

See the full set of options and documentation by invoking `vmq-admin retain show --help`.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.vernemq.com/1.8.0/administration/retained-store.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
