frankvicky commented on code in PR #17549:
URL: https://github.com/apache/kafka/pull/17549#discussion_r1807321405


##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/AbstractMembershipManager.java:
##########
@@ -80,10 +81,12 @@ public abstract class AbstractMembershipManager<R extends 
AbstractResponse> impl
     protected final String groupId;
 
     /**
-     * Member ID assigned by the server to the member, received in a heartbeat 
response when
-     * joining the group specified in {@link #groupId}
+     * Member ID generated by the consumer at startup, which is unique within 
the group and remains consistent
+     * for the entire lifetime of the process. This ID acts as an incarnation 
identifier for the consumer process
+     * and does not reset or change, even if the consumer leaves and rejoins 
the group.
+     * The Member ID remains the same until the process is completely stopped 
or terminated.
      */
-    protected String memberId = "";
+    protected final String memberId = Uuid.randomUuid().toString();

Review Comment:
   According to KIP-1082, the `memberId` should remain unchanged until the 
process terminates, so I added the `final` modifier.



-- 
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]

Reply via email to