Skip to content

Commit

Permalink
adding client id to observer
Browse files Browse the repository at this point in the history
  • Loading branch information
JobseRyan committed Mar 12, 2024
1 parent 348c434 commit ee9c4e2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion core/src/main/scala/kafka/server/KafkaApis.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1952,7 +1952,7 @@ class KafkaApis(val requestChannel: RequestChannel,
hasNonXinfraClient = true;
}
}
observer.checkClientLibrary(hasNonXinfraClient)
observer.checkClientLibrary(hasNonXinfraClient, request.context.clientId())
if (!expectedClientSoftwareNames.contains(softwareName)) {
val clientIdentity = request.context.clientId() + " " + request.context.clientAddress() + " " + request.context.principal()
unofficialClientsCache.get(clientIdentity)
Expand Down
5 changes: 3 additions & 2 deletions core/src/main/scala/kafka/server/Observer.scala
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,10 @@ trait Observer extends Configurable {
/**
* Check client library. Users pass in the client library and version so the client type can be checked
*
* @param hasNonXinfraClient flag to determine if the topic has been accessed by a non xinfra client
* @param hasNonXinfraClient flag to determine if the topic has been accessed by a non xinfra client
* @param clientId The clientId for this specific request
*/
def checkClientLibrary(hasNonXinfraClient: Boolean): Unit
def checkClientLibrary(hasNonXinfraClient: Boolean, clientId: String): Unit

/**
* Close the observer with timeout.
Expand Down

0 comments on commit ee9c4e2

Please sign in to comment.