Documentation

Deleting Messages

The Delete Records dialog removes Kafka records before selected Offsets by advancing the start Offset for each selected Partition. Records with Offsets lower than the selected Delete Before Offset are deleted. The selected Offset itself becomes the first Offset to keep.

Deleting records is permanent. After the operation succeeds, older records are no longer available to consumers or to Offset Explorer.

Opening the Delete Records Dialog

You can open the dialog from either a Topic or a Partition. When opened from a Topic, the dialog includes all Partitions in that Topic. When opened from a Partition, the dialog includes only that Partition.

  • Open a Topic, select the Properties tab, and click "Delete Records".
  • Open a Partition, select the Properties tab, and click "Delete Records".
  • Right-click a Topic in the browser tree, Topics tree, or Topics list, and choose "Delete Records".
  • Right-click a Partition in the browser tree and choose "Delete Records".
  • On a Topic's Partitions tab, select one Partition and use the delete button.
  • In a message table, right-click one loaded message and choose "Delete All Earlier Records". This opens the dialog for that message's Partition and preselects the message Offset as the Delete Before Offset.

Properties

The Properties section identifies the target Kafka connection and Topic. These fields are read-only and are shown so you can verify the data source before deleting records.

  • Connection - the server connection that contains the Topic.
  • Topic - the Topic whose records will be deleted.

Records to Delete

The Records to Delete section controls how the Delete Before Offset values are chosen.

  • Delete All Records - sets Delete Before Offset to the current End Offset for each included Partition.
  • Delete before timestamp - enables the timestamp field, calendar button, and "Calculate Offsets" button.
  • Timestamp field - enter the timestamp to use when looking up Offsets. The format follows the Topic timestamp display settings.
  • Calendar button - opens a timestamp picker and fills the timestamp field.
  • Calculate Offsets - asks Kafka for the first Offset at or after the timestamp for each included Partition, then updates the table.

If "Delete before timestamp" is selected, the dialog recalculates the timestamp Offsets again when you click "Delete Records" so the delete request uses current Offset information.

Partition Offsets

The Partition Offsets table shows the current Offset range and the planned deletion for each Partition.

  • Partition - the Partition being changed.
  • Start - the current first available Offset.
  • End - the current end Offset.
  • Delete Before Offset - the first Offset to keep. You can edit this cell directly.
  • Records To Delete - the number of records that will be removed from the Partition.

To choose explicit Offsets, double-click a Delete Before Offset cell, type the new Offset, and press Enter. Values are kept within the Partition's current Start and End Offset range.

Deleting Records

Click "Delete Records" to run the delete operation. Offset Explorer validates the selected Offsets and shows an error if no records are selected for deletion. Before sending the request to Kafka, it shows a confirmation message with the total number of records that will be deleted from the Topic.

After the delete completes, the results dialog lists each changed Partition with its old start Offset, records deleted, and new start Offset. The Topic or Partition view is refreshed after the dialog closes.

Command-Line Support

Records can also be deleted with the deleteRecords command-line option. See the deleteRecords command-line documentation for syntax and examples.

Offset Explorer | UI Tool for Apache Kafka