-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/* | ||
* Copyright 2019-2022 the original author or authors. | ||
* Copyright 2019-2024 the original author or authors. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
|
@@ -35,6 +35,7 @@ | |
* Common consumer properties. | ||
* | ||
* @author Gary Russell | ||
* @author Soby Chacko | ||
* @since 2.3 | ||
* | ||
*/ | ||
|
@@ -116,6 +117,12 @@ public class ConsumerProperties { | |
|
||
private boolean checkDeserExWhenValueNull; | ||
|
||
/** | ||
* Container group protocol that will be set on the Kafka Consumer. | ||
* Default to classic consumer protocol. | ||
*/ | ||
private String groupProtocol; | ||
|
||
/** | ||
* Create properties for a container that will subscribe to the specified topics. | ||
* @param topics the topics. | ||
|
@@ -501,6 +508,23 @@ public void setCheckDeserExWhenValueNull(boolean checkDeserExWhenValueNull) { | |
this.checkDeserExWhenValueNull = checkDeserExWhenValueNull; | ||
} | ||
|
||
/** | ||
* Return the container's group protocol. | ||
* @return Container group protocol set via the group.protocol Consumer property | ||
*/ | ||
public String getGroupProtocol() { | ||
return this.groupProtocol; | ||
} | ||
|
||
/** | ||
* Set the container group protocol. | ||
* | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No blank lines in method Javadocs. There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 Do you still see a need to set this somewhere in the framework? |
||
* @param groupProtocol group protocol via the group.protocol Consumer property | ||
*/ | ||
public void setGroupProtocol(String groupProtocol) { | ||
this.groupProtocol = groupProtocol; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "ConsumerProperties [" | ||
|
There was a problem hiding this comment.
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...