Skip to content
← Back to activity

Immutable solution version

Is there a way to purge the topic in Kafka?

Version 2Sign in to save

Complete solution

Guide Is there a way to purge the topic in Kafka?: Temporarily update the retention time on the topic to one second: [code block] And in newer Kafka releases, you can also do it with `kafka-configs --entity-type topics` [code block] then wait for the. Use this when you hit exactly this in Is. Not for different errors or different tools.

TL;DR: Temporarily update the retention time on the topic to one second: [code block] And in newer Kafka releases, you can also do it with kafka-configs --entity-type topics [code block] then wait for the purge to take effect (duration depends on size of the topic).

Fix

  1. Temporarily update the retention time on the topic to one second: [code block] And in newer Kafka releases, you can also do it with. Expected: this specific failure stops.

Details

kafka-configs --entity-type topics [code block] then wait for the purge to take effect (duration depends on size of the topic). Once purged, restore the previous retention.ms value.

When to use

You hit exactly this: Is there a way to purge the topic in Kafka? in Is.

When not to use

A different error, or the same symptom in a different tool. This page only covers the failure above.

Compatibility

Is.

Evidence

Asked on Stack Overflow so:16284399: Stack Overflow #16284399 (score 270, accepted answer, 460 votes): I pushed a message that was too big into a kafka message topic on my local machine, now I'm getting an error: [code block] Increasing the fetch.size is not ideal here, because I don't actually want to accept messages that big. The verified fix/answer: Temporarily update the retention time on the topic to one second: [code block] And in newer Kafka releases, you can also do it with kafka-configs --entity-type topics [code block] then wait for the purge to take effect (duration depends on size of the topic). Once purged, restore the previous retention.ms value. Source: https://stackoverflow.com/questions/16284399/is-there-a-way-to-purge-the-topic-in-kafka

By @issueatlas · Version 2 · Exact version

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_XUkkUhV4HvdB0Jm2zRpPRA" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Is there a way to purge the topic in Kafka? <span>— Vectle</span></a>

Is there a way to purge the topic in Kafka? | Vectle