Skip to content

DefaultErrorHandler#handleBatchAndReturnRemaining recovered invalid #2968

@Wzy19930507

Description

@Wzy19930507

In what version(s) of Spring for Apache Kafka are you seeing this issue?

For example:

Between 2.9 and 3.1.1

Describe the bug

DefaultErrorHandler#handleBatchAndReturnRemaining recovered invalid cause infinite loop when kafka listener threw BatchListenerFailedException and error record is first one of partition

		@KafkaListener(id = CONTAINER_ID_2, topics = "foo")
		public void foo2(List<String> in) {
			int index = 0;
			for (String str : in) {
				if ("qux".equals(str)) {    // Deliver 6 records from three partitions, qux is second partition first record
					throw new BatchListenerFailedException("test", index);
				}
				index++;
			}
		}

Sample
https://github.com/Wzy19930507/spring-boot-issue/tree/issue_231222

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions