Which command shifts offsets by 2 positions forward for a consumer group on a topic?

Study for the CCDAK Apache Kafka Test. Use flashcards and multiple choice questions with hints and explanations for each question. Prepare thoroughly for your exam!

Multiple Choice

Which command shifts offsets by 2 positions forward for a consumer group on a topic?

Explanation:
Shifting offsets by a fixed amount is done with the reset-offsets command using a shift-by value. When you specify --group and --topic, plus --reset-offsets and --execute, the consumer group's committed offsets on each partition of that topic are moved by the exact number you provide. Using --shift-by 2 advances every partition’s offset by two messages, so the group will start consuming two messages later than before. This is a relative adjustment, not a jump to the earliest or newest offset. In contrast, options like --to-earliest or --to-latest reposition to fixed points, and --shift-by 0 would leave offsets unchanged. So the command that performs the requested forward shift by two positions is the one that uses --reset-offsets with --shift-by 2, along with the necessary --group, --topic, and --execute flags.

Shifting offsets by a fixed amount is done with the reset-offsets command using a shift-by value. When you specify --group and --topic, plus --reset-offsets and --execute, the consumer group's committed offsets on each partition of that topic are moved by the exact number you provide. Using --shift-by 2 advances every partition’s offset by two messages, so the group will start consuming two messages later than before. This is a relative adjustment, not a jump to the earliest or newest offset. In contrast, options like --to-earliest or --to-latest reposition to fixed points, and --shift-by 0 would leave offsets unchanged. So the command that performs the requested forward shift by two positions is the one that uses --reset-offsets with --shift-by 2, along with the necessary --group, --topic, and --execute flags.

Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy