pratapaditya04 commented on code in PR #4098:
URL: https://github.com/apache/gobblin/pull/4098#discussion_r1957698524


##########
gobblin-temporal/src/main/java/org/apache/gobblin/temporal/GobblinTemporalConfigurationKeys.java:
##########
@@ -74,4 +80,22 @@ public interface GobblinTemporalConfigurationKeys {
 
   String DYNAMIC_SCALING_POLLING_INTERVAL_SECS = DYNAMIC_SCALING_PREFIX + 
"polling.interval.seconds";
   int DEFAULT_DYNAMIC_SCALING_POLLING_INTERVAL_SECS = 60;
+
+  /**
+   * Generates a unique task queue name for Gobblin Temporal task queue.
+   * The task queue name is created by concatenating a prefix from the 
configuration
+   * with a randomly generated UUID.
+   *
+   * @param config the configuration object from which to retrieve the queue 
prefix
+   * @return a unique task queue name
+   * @throws NullPointerException if the provided config is null
+   */
+  static String getTemporalTaskQueueName(Config config) {
+    Objects.requireNonNull(config, "Config must not be null");
+
+    final String queuePrefix =
+        ConfigUtils.getString(config, 
GobblinTemporalConfigurationKeys.GOBBLIN_TEMPORAL_TASK_QUEUE,
+            
GobblinTemporalConfigurationKeys.DEFAULT_GOBBLIN_TEMPORAL_TASK_QUEUE);
+    return queuePrefix + UUID.randomUUID();
+  }

Review Comment:
   IMO this doesnt belong to AbstractTemporalWorker ,as this contains logic to 
create a configuration value, which in this case is temporalTaskQueueName. 
   In the available classes GobblinTemporalConfigurationKeys seemed the most 
fit classs for this, as this class deals with configuration keys for temporal.
   
   Directly annotating can work, but didn't want to import lombok in this class 
just for this use case. As this also does the same thing so didn't feel need to 
bring lombok in the picutre in this class just for this



-- 
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: dev-unsubscr...@gobblin.apache.org

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

Reply via email to