<a id="c3-topic-message-browser"></a>

# View Messages Using Control Center for Confluent Platform

In Confluent Control Center, message browser enables you to view, produce, and download messages produced to a topic.
You can browse message data across all partitions, seek data from specific offsets or
timestamps by partition, and produce and download messages. Messages can be produced with or without a schema.
Messages with a schema can be validated by message browser before you produce them to the topic.

**Considerations**:

- By default, message browser displays newer data at the top of the messages pane.
- Filter across any of the available columns.
- You can only filter results that are displayed. To add more results to the current display,
  increase the maximum results, manipulate the start time, or add partitions.
- In Confluent Control Center, message browser displays only the default schema for messages that have multiple schemas.
- Only [TopicNameStrategy](/platform/current/schema-registry/fundamentals/serdes-develop/index.html#sr-schemas-subject-name-strategy) schemas
  are used to deserialize messages.
- Non-compacted topics show a tile for **Total messages** while compacted topics show a tile
  for **Storage**.

**Prerequisites**:

- You must have data being produced to a topic or already present in a topic to use message browser.
- Messages cannot be viewed if LDAP Basic Auth is implemented and the user is a
  member of a restricted group. If users need to view messages, consider using
  RBAC instead of LDAP Basic Auth.

<a id="c3-inspect-topic"></a>

<a id="c3-change-layout"></a>

<a id="c3-msgs-filter-keyword"></a>

<a id="c3-msgs-jump-time"></a>

<a id="c3-msgs-jump-offset"></a>

<a id="c3-msgs-jump-timestamp"></a>

<a id="c3-browse-stream"></a>

## Inspect topics

Message browser enables you to inspect topic details and browse messages. If you don’t
have data in the topic, use the
[built-in produce new message feature](#c3-produce-topic) to send a message to the topic.
You can replay old data that was already produced as long as it hasn’t been compacted or deleted yet.

To browse messages and inspect topics:

1. Select a cluster.
2. Select **Topics** in the navigation menu. The Topics page appears.
3. Select the topic you want to inspect.
4. Select **Messages**. The **Messages** page displays messages for the topic.
   ![Message browser in Confluent Cloud](images/c3-messages-full-screen.png)
5. To browse the messages pane use the following features:
   - **Max results** drop down changes the maximum displayed result.
     ![Max results drop down in message browser](images/s3-messages-max-results.png)
   - **Auto-refresh** toggle pauses and resumes message browser updates. The topic continues
     to receive any messages produced during a pause, but message browser pauses the display.
     ![Auto-refresh toggle in message browser, in the refresh messages position](images/c3-messages-refresh.png)
   - **Filter by timestamp, offset, key or value** filter results by the specified criteria.
     Enter a timestamp in Unix epoch format. Enter an offset, key, or any string value to
     filter by that value.
     ![Filter criteria box in message browser](images/c3-messages-filter.png)
   - Select a row to access the contents of the message. A message detail pane opens.
     In **Message details**, select **Key**, **Value**, or **Headers**.
     ![Message detail pane in message browser](images/c3-messages-inspect-message.png)
   - Use **Latest**, **From beginning**, **From offset**, **From timestamp**, or
     **From specific time** to refine message searches.
     ![Refine message search by time or location drop down in message browser](images/c3-messages-dropdown.png)<details>
     <summary style="display: list-item; cursor:pointer; color:#337ab7;">
     From beginning, From timestamp, or From specific time details
     </summary>

     **Latest**

     The latest messages from the topic. By default, the latest messages are displayed
     upon first entering message browser.
     - To view the latest messages from the topic, select **Latest**.

     **From beginning**

     View the earliest messages from the topic, up to the selected maximum amount.
     - To view the earliest messages from the topic, select **From beginning**.

     **From offset**

     View messages from a specific offset, up to the selected maximum amount.
     - To view messages from an offset, select a partition, then select **From offset**
       and enter the offset.
       ![Seek messages from a specific date in message browser](images/c3-messages-set-offset.png)

     **From timestamp**

     When you seek to a specified time, message browser reads messages from the selected time
     onwards until the maximum limit of results is reached.
     - To jump to a message timestamp, select **From timestamp** and enter the timestamp in milliseconds.
       ![Seek messages from a timestamp in message browser](images/c3-messages-set-timestamp.png)

     **From specific time**
     1. Select the **From specific time** menu.
     2. Select the default current date and time box to open a calendar.
     3. Select a calendar date. Use the arrows to go forward or back and select a month and day.
        ![Seek messages from a specific date in message browser](images/c3-messages-set-date.png)
     4. Select the time box to adjust the time in hours, minutes, seconds, and AM or PM.
        ![Seek messages from a specific time in message browser](images/c3-messages-set-time.png)
     5. Select **Apply**.

     </details>

<a id="c3-produce-topic"></a>

## Produce new messages to topics

You can produce messages to topics using message browser. All of the
following message related tasks are supported:

- Produce messages to a topic
- Validate messages you create for topics that enforce a schema
- Determine if a topic enforces a schema
- Add headers to messages

**Considerations**:

- The maximum size of messages produced by message browser is 65 KB.
- Message browser schema validation does not respect Schema Registry data contract rules.
- Message browser supports all the Schema Registry supported draft versions of JSON Schema.
- JSON schemas of one draft type that reference JSON schemas of a different draft
  type are not fully supported and may cause issues.
- While Protocol Buffers (protobuf) supports nested messages, message browser does not. Only top-level
  messages are validated. This means while you can define another message type inside a protobuf message,
  message browser only validates (and allows you to select) the top-level message.
- Proto3 version of protobuf revokes support for required fields. This limit isn’t unique to
  message browser but is mentioned here as a reminder that validation ignores optional fields in protobuf messages and
  only applies to defined messages.

![Produce messages in message browser](images/c3-messages-produce.png)

### Produce message with schema

To produce new messages with a schema:

1. Select **Produce new message**.
2. Enter your message.
3. (Optional) Select **Validate**.
4. (Optional) Select **Add header**.
   1. Enter your header.
   2. (Optional) Add more headers as necessary.
5. Select **Produce**.

### Produce message without schema

To produce new messages without a schema:

1. Select **Produce new message**.
2. In **Select schema** under **Key** or **Value**, select **Produce without schema** and then
   select **Continue** to dismiss the prompt.
3. Enter your message.
4. (Optional) Select **Headers** and then select **Add header**.
   1. Enter your header.
   2. (Optional) Add more headers as necessary.
5. Select **Produce**.

### Inspect schema enforcement

To determine if the current topic enforces a schema:

1. Select **Produce new message**.
2. To determine if the topic enforces a schema, review **Select schema** for **Key** and **Value**:
   - **No schema available** - no schema is associated with **Key** or **Value**
   - **Default - <topic-name>-key|value** - the default schema associated with **Key** or **Value**
   - **<qualified-subject> - <topic-name>-key|value** - additional schemas associated with **Key** or **Value**

   If multiple schemas are associated with a topic for serialization or deserialization, message browser
   uses a `TopicNameStrategy` to organize them.

<a id="c3-download-selected-topics-msgs"></a>

## Download topic messages

Use the bulk download option to download the currently displayed set of results.

**Considerations**:

- You can download messages as JSON or CSV.
- Filter results to limit what you download.
- Use the message shown count indicator to determine how many messages of the current set you would download. For example,
  if limit maximum results is set to 50 (the default) and you filter 25 messages, you see a message that reads **25 of
  50 messages shown**. This message indicates that only you will only download 25 messages.

**To download messages**:

- Select the download icon for JSON or CSV. A file that contains the selected messages in the selected
  format is downloaded into your downloads directory.
  ![Download messages in message browser](images/c3-messages-download.png)

Example filenames:

- `Download message as JSON_2024-09-20T22_51_38.775Z.json`
- `Download message as CSV_2024-09-20T22_51_36.320Z.csv`

Example JSON content:

```json
[
   {
      "partition": 0,
      "offset": 0,
      "timestamp": 1726872675795,
      "timestampType": "CREATE_TIME",
      "key": "test",
      "value": {
         "ordertime": 1497014222380,
         "orderid": 18,
         "itemid": "Item_184",
         "address": {
         "city": "Mountain View",
         "state": "CA",
         "zipcode": 94041
         }
      },
      "headers": []
   }
]
```

<a id="ff-c3-inspect-topic"></a>

## Enable and disable message browsing in Control Center

The topic inspection feature is enabled by default in Control Center. The feature
can be disabled if an organization does not want any users to access the feature.
After disabling the feature, the **Messages** tab is no longer
visible in the Control Center UI.

To disable the topic inspection feature in Control Center:

1. Set the `confluent.controlcenter.topic.inspection.enable` option in your
   `control-center.properties` file to `false`.
   ```bash
   ...
   confluent.controlcenter.topic.inspection.enable=false
   ...
   ```

   #### NOTE
   Make the change in the appropriate Control Center properties file or
   files configured for your environments, including
   `control-center-dev.properties` or `control-center-production.properties`.
   The properties files are located in `/path-to-confluent/etc/confluent-control-center/`.
   For more information, see [Control Center Configuration Examples for Confluent Platform](../installation/properties.md#c3-properties-files).
2. Restart Control Center and pass in the properties file for the configuration to
   take effect. For more information about restarting Control Center and passing in its
   properties files, see [Control Center Configuration Examples for Confluent Platform](../installation/properties.md#c3-properties-files).
   ```bash
   ./bin/control-center-stop
   ./bin/control-center-start ../etc/confluent-control-center/control-center.properties
   ```
3. To re-enable the topic feature, set the option back to `true` and restart
   Control Center with the updated properties file.

## Search audit log

When you are searching the [audit log](/platform/current/security/compliance/audit-logs/audit-logs-concepts.html#audit-logs-concepts) for user activity in the
message browser, you must use the format `User:<username>`. To navigate to the audit log,
click **Cluster** > **Topics** > `confluent-audit-log-events` > **Messages** tab.

## Additional resources

* [Creating Messages from within Control Center (blog post)](https://www.confluent.io/blog/create-kafka-messages-from-within-control-center-for-better-kafka-management/)
* [Exporting Messages via Control Center (blog post)](https://www.confluent.io/blog/better-kafka-management-export-messages-within-confluent-control-center-part-2/)
