Skip to content
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

GH-3254: Group protocol in ConsumerProperties #3255

Closed
wants to merge 1 commit into from

Conversation

sobychacko
Copy link
Contributor

Fixes: #3254

  • Add group.protocol property to ConsumerProperties

Fixes: spring-projects#3254

* Add group.protocol property to ConsumerProperties

/**
* Set the container group protocol.
*
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No blank lines in method Javadocs.
The @since is supposed to be there on the public API.
And why is this property is not set on the target KafkaConsumer in this PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this PR, we are not really using this property directly - but rather giving an opportunity to set it via the ConsumerProperties. This property needs to be eventually exposed from Spring Boot auto-configuration, so this PR is sort of the ground work. As this new consumer-group evolves, I would imagine that we may need to make more changes in the framework. At this point, we simply pass it down to the KafkaConsumer as it is if it is set. Otherwise, the KafkaConumser uses the defaults. https://github.com/spring-projects/spring-kafka/blob/main/spring-kafka/src/main/java/org/springframework/kafka/listener/KafkaMessageListenerContainer.java#L862

Do you still see a need to set this somewhere in the framework?

* Container group protocol that will be set on the Kafka Consumer.
* Default to classic consumer protocol.
*/
private String groupProtocol;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't there some enum to rely on?
Or we might introduce one as an inner in this ConsumerProperties class...

@sobychacko
Copy link
Contributor Author

Closing the PR after further discussing it internally. We don't really need this at this point. We can use the same property as below: spring.kafka.consumer.properties[group.protocol]=CONSUMER.

@sobychacko sobychacko closed this May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add group.protocol property to ConsumerProperties
2 participants