Skip to content

processCommits method and this.count #623

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Gunju-Ko opened this issue Mar 26, 2018 · 1 comment
Closed

processCommits method and this.count #623

Gunju-Ko opened this issue Mar 26, 2018 · 1 comment

Comments

@Gunju-Ko
Copy link
Contributor

Gunju-Ko commented Mar 26, 2018

I am really sorry that I am not good at english

I have a question about processCommits method in ListenerConsumer

In the processCommits() method in the ListenerConsumer, this.acks.size () is added to this.count.
however after handleAcks() method is called, this.acks is always empty. As a result, always 0 is added to this.count. I think before call the handleAcks method, acks.size() is added to this.count.

below is the code processCommits method and handleAcks method in ListenerConsumer.

private void processCommits() {
	handleAcks();
	this.count += this.acks.size();
	long now;
	AckMode ackMode = this.containerProperties.getAckMode();
                        
        // skip

}
private void handleAcks() {
	ConsumerRecord<K, V> record = this.acks.poll();
	while (record != null) {
		if (this.logger.isTraceEnabled()) {
			this.logger.trace("Ack: " + record);
		}
		processAck(record);
		record = this.acks.poll();
	}
}

I am very sorry that the explanation is very poor.

@garyrussell
Copy link
Contributor

Yes; this is a bug; thanks.

garyrussell added a commit to garyrussell/spring-kafka that referenced this issue Mar 26, 2018
Fixes spring-projects#623

Grab ack count before moving acks to offsets.
artembilan pushed a commit that referenced this issue Mar 26, 2018
Fixes #623

Grab ack count before moving acks to offsets.
artembilan pushed a commit that referenced this issue Mar 26, 2018
Fixes #623

Grab ack count before moving acks to offsets.

# Conflicts:
#	spring-kafka/src/test/java/org/springframework/kafka/listener/KafkaMessageListenerContainerTests.java
artembilan pushed a commit that referenced this issue Mar 26, 2018
Fixes #623

Grab ack count before moving acks to offsets.

# Conflicts:
#	spring-kafka/src/test/java/org/springframework/kafka/listener/KafkaMessageListenerContainerTests.java
denis554 added a commit to denis554/spring-kafka that referenced this issue Mar 27, 2019
Fixes spring-projects/spring-kafka#623

Grab ack count before moving acks to offsets.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants