jeffkbkim commented on code in PR #12847:
URL: https://github.com/apache/kafka/pull/12847#discussion_r1035483192
##########
core/src/main/scala/kafka/server/KafkaApis.scala:
##########
@@ -1696,45 +1696,37 @@ class KafkaApis(val requestChannel: RequestChannel,
def handleSyncGroupRequest(request: RequestChannel.Request, requestLocal:
RequestLocal): Unit = {
val syncGroupRequest = request.body[SyncGroupRequest]
- def sendResponseCallback(syncGroupResult: SyncGroupResult): Unit = {
- requestHelper.sendResponseMaybeThrottle(request, requestThrottleMs =>
- new SyncGroupResponse(
- new SyncGroupResponseData()
- .setErrorCode(syncGroupResult.error.code)
- .setProtocolType(syncGroupResult.protocolType.orNull)
- .setProtocolName(syncGroupResult.protocolName.orNull)
- .setAssignment(syncGroupResult.memberAssignment)
- .setThrottleTimeMs(requestThrottleMs)
- ))
+ def sendResponse(response: AbstractResponse): Unit = {
+ trace("Sending sync group response %s for correlation id %d to client
%s."
+ .format(response, request.header.correlationId,
request.header.clientId))
+ requestHelper.sendResponseMaybeThrottle(request, requestThrottleMs => {
+ response.maybeSetThrottleTimeMs(requestThrottleMs)
+ response
+ })
Review Comment:
thoughts on reusing this? it's identical to handleJoinGroupRequest except
for the response type and it looks like we can use this for the other
coordinator APIs as well
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]