Documentation

Exporting Messages

The Export tool copies Kafka messages either to files on the local file system or directly to another Topic. It can export a range of messages from selected source partitions, start reading at a specific timestamp, or export only the messages currently selected in the data panel.

Opening the Export Tool

Open the full wizard from the Tools menu by selecting "Export...". The first page asks you to select a source Topic.

When viewing messages for a Topic or Partition, the Export toolbar button opens the tool directly on the Settings page and automatically selects the current source Topic.

To export specific rows, select one or more messages in the data table, right-click, and choose "Export Selection". The tool opens directly on the Settings page with "Selected Messages" chosen. In this mode, the Number of Messages and Source Partitions controls are hidden because the selected rows define exactly what will be exported.

Dialog Overview

The Export tool uses a three-page wizard.

  1. Source Page - select the Topic whose messages will be exported, or load a saved export project.
  2. Settings Page - choose the destination type, message range, source partitions, and export options.
  3. Results Page - review the total exported messages and per-partition results.

Source Page

Select the source Topic and click Next. Offset Explorer loads its partitions and opens the Settings page. The source Topic is selected automatically when the tool is opened from a message data panel.

Load Project and the recent-project button are shown on this page. A saved project restores the source Topic, destination, message range, selected partitions, and export options.

Export Type

The Type dropdown at the top of the Settings page controls where messages are written.

  • File System - writes message keys and values to binary files in a destination directory.
  • Topic - produces the selected parts of each message to a destination Topic.

Changing the export type changes the destination and message-option panels shown below it.

File System Export

Choose a Destination Directory and select whether keys, values, or both should be exported. The destination directory must already exist.

Key File Pattern and Value File Pattern control the generated file names. Both patterns must contain:

  • #pid# - replaced with the source partition id, padded to five digits.
  • #oid# - replaced with the source message offset, padded to eighteen digits.

The key and value patterns must be different when both are enabled. Message data is written as raw bytes; the Export tool does not decode or convert the key or value.

Topic Export

Select a Destination Topic from the Topic tree. The source and destination Topic cannot be the same Topic on the same server connection.

The Message Options panel controls which parts of each source record are sent:

  • Include Keys - copies the message key. When unchecked, the exported record has a null key.
  • Include Values - copies the message value. When unchecked, the exported record has a null value.
  • Include Headers - copies all Kafka headers. When unchecked, no headers are added.
  • Preserve Timestamp - sends the original record timestamp. This option is unchecked by default; when unchecked, Kafka assigns the timestamp.

The destination partition is not forced. Kafka selects it using the producer's normal partitioning behavior, based on the exported key and the destination Topic.

Messages to Export

For normal Topic exports, choose a message range and enter the Number of Messages per selected source partition.

  • First N Messages - starts at the oldest available message in each selected partition.
  • Last N Messages - exports the most recent messages from each selected partition.
  • Start From Specific Timestamp - starts at the first available message at or after the entered timestamp. Type a timestamp or use the date picker.
  • Selected Messages - available when the tool was opened with Export Selection. Only the selected table rows are exported.

For First N, Last N, and timestamp exports, use Source Partitions to choose which source partitions are included. Number of Messages is applied separately to each selected partition.

Exporting Selected Messages

Select rows in the message table, right-click, and choose Export Selection. The selected records retain their source partition and offset information for file naming and results reporting.

Selected messages can be exported to either files or a Topic. The File System patterns use each selected row's actual partition and offset. Topic export applies the selected Include Keys, Include Values, Include Headers, and Preserve Timestamp options to every selected record.

Saving and Loading Projects

Save Project appears on the Settings and Results pages. It saves the current export configuration as a JSON file. Load Project and the recent-project button appear on the Source page.

A project includes the source and destination Topic identities, export type, destination directory, file patterns, Topic message options, message range, start timestamp, message count, and selected source partitions. Offset Explorer remembers up to 15 recent project files.

Selected table rows are not stored in project files. Saving a project from Selected Messages mode stores the reusable export configuration, not the selected message data.

Running the Export

Click Next on the Settings page to start. The progress dialog displays the number of messages successfully exported. Topic exports send messages asynchronously in batches and wait for pending sends before completing.

Canceling stops further export work. Producer and file errors are reported instead of showing a successful Results page.

Results Page

The Results page contains a summary and a per-partition table.

  • Export Started - the date and time when the export began.
  • Time Taken - total elapsed time in milliseconds.
  • Total Messages - total number of exported source messages.
  • Partition results - message count, first and last source offsets, key bytes, and value bytes for each source partition.

Save Project remains available on the Results page, and Back returns to the Settings page.

Offset Explorer | UI Tool for Apache Kafka