jackhalfalltrades commented on code in PR #307:
URL: https://github.com/apache/atlas/pull/307#discussion_r2069503894


##########
webapp/src/main/java/org/apache/atlas/notification/NotificationHookConsumer.java:
##########
@@ -492,8 +542,30 @@ private void startConsumers(ExecutorService 
executorService) {
 
             HookConsumer hookConsumer = new HookConsumer(hookConsumerName, 
consumer);
 
-            consumers.add(hookConsumer);
-            executors.submit(hookConsumer);
+            hookConsumers.add(hookConsumer);
+        }
+        startConsumers(executorService, hookConsumers);
+    }
+
+    private void startConsumers(ExecutorService executorService, 
List<HookConsumer> hookConsumers) {
+        if (consumers == null) {
+            consumers = new ArrayList<>();
+        }
+
+        if (executorService == null) {
+            executorService = new ThreadPoolExecutor(
+                    0, // Core pool size
+                    Integer.MAX_VALUE, // Maximum pool size (dynamic scaling)
+                    60L, TimeUnit.SECONDS, // Idle thread timeout
+                    new SynchronousQueue<>(), // Direct handoff queue
+                    new ThreadFactoryBuilder().setNameFormat(THREADNAME_PREFIX 
+ " thread-%d").build());
+
+            executors = executorService;
+        }
+
+        for (final HookConsumer consumer : hookConsumers) {
+            consumers.add(consumer);
+            executors.submit(consumer);

Review Comment:
   For some reason this seem to be an older commit, the changes are available 
in the recent commits



-- 
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...@atlas.apache.org

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

Reply via email to