philipnee commented on code in PR #12775:
URL: https://github.com/apache/kafka/pull/12775#discussion_r1001080536


##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/PrototypeAsyncConsumer.java:
##########
@@ -113,13 +182,23 @@ public void commitSync(final Duration timeout) {
         try {
             commitFuture.get(timeout.toMillis(), TimeUnit.MILLISECONDS);
         } catch (final TimeoutException e) {
-            throw new 
org.apache.kafka.common.errors.TimeoutException("timeout");
+            throw new org.apache.kafka.common.errors.TimeoutException(
+                     "timeout");
         } catch (final Exception e) {
             // handle exception here
             throw new RuntimeException(e);
         }
     }
 
+    /**
+     * Get the current subscription.  or an empty set if no such call has
+     * been made.
+     * @return The set of topics currently subscribed to
+     */
+    public Set<String> subscription() {
+        return Collections.unmodifiableSet(new 
HashSet<>(this.subscriptions.subscription()));

Review Comment:
   I think subscription is thread safe~



-- 
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: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to