Country or region and language

    Choose your country or region and your language.

    Suggested for you

      All countries and regions

        Choose your character

        It shows in the top bar and on your profile. Change it any time.

        Kafka cheat sheet: commands and offsets

        Use this reference to connect a command to the state it inspects or changes. Verify the target cluster and topic before running administrative commands in a real environment.

        Checked 14 November 2026

        Command families

        Command Purpose Result to inspect
        kafka-topics.sh Create, list or describe a topic Partition count, leader, replicas and in-sync set
        kafka-configs.sh Inspect or alter supported configuration Topic retention, cleanup policy and minimum in-sync replicas
        kafka-console-producer.sh Send records Key, partition and appended offset
        kafka-console-consumer.sh Read records Starting offset, group and isolation behavior
        kafka-consumer-groups.sh Describe groups or reset offsets Committed offsets, log end and lag

        The lesson supplies complete supported commands in the browser workspace. Its lab commands are teaching controls, not tools distributed with Kafka. Real command options and defaults depend on your installed release.

        Offset arithmetic

        A committed offset of 8 means the next record to read is offset 8. If the log end is 11, the simple end-minus-commit lag is 3. That does not measure elapsed time or prove the downstream business operation succeeded. Deleted and compacted records can leave holes in the offset sequence.

        Replay and cleanup

        Preview an offset reset and identify the affected group before applying it. Reprocessing can repeat external writes. Retention removes eligible log data; compaction eventually retains the latest value for a key and handles tombstones under its configured rules. Neither setting replaces an application recovery plan.

        Review the interview scenarios or study stream processing after the partition model is clear.

        Sources

        Your Work Gym account

        Save your progress and pick up on another device. Your browser's progress comes with you.

        or

        You can keep practicing without an account.

        Help and feedback

        Ask a question, tell us what is not working, or share an idea. We reply by email.

        What is it about?

        We use it only to reply to you.