> For the complete documentation index, see [llms.txt](https://docs.pentaho.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.pentaho.com/pdia-data-integration/10.2-data-integration/pdi-transformation-steps-reference-overview/kafka-consumer/options-kafka-consumer/offset-settings-tab/modes-kafka-consumer.md).

# Modes

You can run the Kafka consumer step in three different modes using the Offset Settings tab.

* Infinite loop
* End Timestamp to stop consumer
* Read data between two-time stamps

## Infinite loop

If you do not enter a value in the **Offset timestamp** field, the Kafka consumer runs in an infinite loop by default.

## End Timestamp to stop consumer

When you enter a value in **Offset timestamp** field, it is considered as the end time and the consumer stops when it reaches that time.

## Read data between two timestamps

By using the Kafka consumer step in conjunction with the Kafka Offset job, you can consume data between a start time and an end time, using either secure or non-secure connections. The **Offset timestamp** value in the Kafka Offset job is considered the start time and the **Offset timestamp** value in the Kafka Consumer step is considered the end time.

For example, if you set the **Offset timestamp** value in the Kafka Offset job to `23/08/02 07:03:00` and set the **Offset timestamp** value in the Kafka consumer step to `23/08/04 07:03:00`, you will consume the data for a 48 hour period.

**Note:** The Kafka Offset job resets the offset of all the partitions in the topic of consumer group according to the job **Offset timestamp**.

This`kafka_job.kjb` sample shown below is located in the `design-tools/data-integration/plugins/pentaho-streaming-kafka-plugin-zip-9.5.1.0-110/pentaho-streaming-kafka-plugin/samples/transformations` directory and demonstrates using the Kafka Offset job with the Kafka consumer step

![Kafka Offset Job with consumer example](/files/PWhdjK08eoNrL4xaiKxP)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.pentaho.com/pdia-data-integration/10.2-data-integration/pdi-transformation-steps-reference-overview/kafka-consumer/options-kafka-consumer/offset-settings-tab/modes-kafka-consumer.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
