Skip to content

KafkaItemReader reset offset to zero for new job instance #3631

Closed
@gmadalon

Description

@gmadalon

OBSERVED BEHAVIOR

KafkaItemReader always reset offset to zero even when the last job execution was finished OK.
So, if my batch runs every night to process a Kafka topic it doesn't work because it will read all messages every night not just the messages not processed.

ROOT CAUSE

KafkaItemReader line 248:

	for (TopicPartition topicPartition : this.topicPartitions) {
		this.partitionOffsets.put(topicPartition, 0L);
	}

PROPOSED SOLUTIONS

Remove these lines and don't set offset to 0 anymore.

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: duplicateIssues that are duplicates of other issues

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions