use of org.apache.kafka.common.message.DescribeGroupsResponseData.DescribedGroup in project kafka by apache.
the class DescribeGroupsResponse method groupMetadata.
public static DescribedGroup groupMetadata(final String groupId, final Errors error, final String state, final String protocolType, final String protocol, final List<DescribedGroupMember> members, final Set<Byte> authorizedOperations) {
DescribedGroup groupMetadata = new DescribedGroup();
groupMetadata.setGroupId(groupId).setErrorCode(error.code()).setGroupState(state).setProtocolType(protocolType).setProtocolData(protocol).setMembers(members).setAuthorizedOperations(Utils.to32BitField(authorizedOperations));
return groupMetadata;
}
use of org.apache.kafka.common.message.DescribeGroupsResponseData.DescribedGroup in project kafka by apache.
the class DescribeGroupsResponse method groupMetadata.
public static DescribedGroup groupMetadata(final String groupId, final Errors error, final String state, final String protocolType, final String protocol, final List<DescribedGroupMember> members, final int authorizedOperations) {
DescribedGroup groupMetadata = new DescribedGroup();
groupMetadata.setGroupId(groupId).setErrorCode(error.code()).setGroupState(state).setProtocolType(protocolType).setProtocolData(protocol).setMembers(members).setAuthorizedOperations(authorizedOperations);
return groupMetadata;
}
use of org.apache.kafka.common.message.DescribeGroupsResponseData.DescribedGroup in project kafka by apache.
the class MessageTest method testThrottleTimeIgnorableInDescribeGroupsResponse.
@Test
public void testThrottleTimeIgnorableInDescribeGroupsResponse() throws Exception {
DescribeGroupsResponseData responseWithGroupInstanceId = new DescribeGroupsResponseData().setGroups(Collections.singletonList(new DescribedGroup().setGroupId("group").setGroupState("Stable").setErrorCode(Errors.NONE.code()).setMembers(Collections.singletonList(new DescribedGroupMember().setMemberId(memberId))).setProtocolType("consumer"))).setThrottleTimeMs(10);
DescribeGroupsResponseData expectedResponse = responseWithGroupInstanceId.duplicate();
// Unset throttle time
expectedResponse.setThrottleTimeMs(0);
testAllMessageRoundTripsBeforeVersion((short) 1, responseWithGroupInstanceId, expectedResponse);
}
use of org.apache.kafka.common.message.DescribeGroupsResponseData.DescribedGroup in project kafka by apache.
the class MessageTest method testDescribeGroupsResponseVersions.
@Test
public void testDescribeGroupsResponseVersions() throws Exception {
DescribedGroupMember baseMember = new DescribedGroupMember().setMemberId(memberId);
DescribedGroup baseGroup = new DescribedGroup().setGroupId("group").setGroupState("Stable").setErrorCode(Errors.NONE.code()).setMembers(Collections.singletonList(baseMember)).setProtocolType("consumer");
DescribeGroupsResponseData baseResponse = new DescribeGroupsResponseData().setGroups(Collections.singletonList(baseGroup));
testAllMessageRoundTrips(baseResponse);
testAllMessageRoundTripsFromVersion((short) 1, baseResponse.setThrottleTimeMs(10));
baseGroup.setAuthorizedOperations(1);
testAllMessageRoundTripsFromVersion((short) 3, baseResponse);
baseMember.setGroupInstanceId(instanceId);
testAllMessageRoundTripsFromVersion((short) 4, baseResponse);
}
use of org.apache.kafka.common.message.DescribeGroupsResponseData.DescribedGroup in project kafka by apache.
the class MessageTest method testGroupInstanceIdIgnorableInDescribeGroupsResponse.
@Test
public void testGroupInstanceIdIgnorableInDescribeGroupsResponse() throws Exception {
DescribeGroupsResponseData responseWithGroupInstanceId = new DescribeGroupsResponseData().setGroups(Collections.singletonList(new DescribedGroup().setGroupId("group").setGroupState("Stable").setErrorCode(Errors.NONE.code()).setMembers(Collections.singletonList(new DescribedGroupMember().setMemberId(memberId).setGroupInstanceId(instanceId))).setProtocolType("consumer")));
DescribeGroupsResponseData expectedResponse = responseWithGroupInstanceId.duplicate();
// Unset GroupInstanceId
expectedResponse.groups().get(0).members().get(0).setGroupInstanceId(null);
testAllMessageRoundTripsBeforeVersion((short) 4, responseWithGroupInstanceId, expectedResponse);
}
Aggregations