Skip to content

Commit

Permalink
spring-projectsGH-3254: Group protocol in ConsumerProperties
Browse files Browse the repository at this point in the history
Fixes: spring-projects#3254

* Add group.protocol property to ConsumerProperties
  • Loading branch information
sobychacko committed May 17, 2024
1 parent 0eb3462 commit b0af3d2
Showing 1 changed file with 25 additions and 1 deletion.
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.
Expand Down Expand Up @@ -35,6 +35,7 @@
* Common consumer properties.
*
* @author Gary Russell
* @author Soby Chacko
* @since 2.3
*
*/
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
*
* @param groupProtocol group protocol via the group.protocol Consumer property
*/
public void setGroupProtocol(String groupProtocol) {
this.groupProtocol = groupProtocol;
}

@Override
public String toString() {
return "ConsumerProperties ["
Expand Down

0 comments on commit b0af3d2

Please sign in to comment.