Skip to content

Commit

Permalink
Use default kafka client id for kafka client instance id (#968)
Browse files Browse the repository at this point in the history
  • Loading branch information
jfallows committed Apr 19, 2024
1 parent 5440606 commit ff16c33
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,13 @@ private static InstanceIdSupplier decodeInstanceId(
private static InstanceIdSupplier defaultInstanceId(
Configuration config)
{
return () -> String.format("%s-%s", KAFKA_CLIENT_ID.get(config), UUID.randomUUID());
return () -> String.format("%s-%s", clientIdWithDefault(config), UUID.randomUUID());
}

private static String clientIdWithDefault(
Configuration config)
{
String clientId = KAFKA_CLIENT_ID.get(config);
return clientId != null ? clientId : KAFKA_CLIENT_ID_DEFAULT;
}
}

0 comments on commit ff16c33

Please sign in to comment.