From 9c5ab1bcd3d65ee6c4dde6eb65763101ced51ccc Mon Sep 17 00:00:00 2001 From: RyanHolstien Date: Mon, 28 Aug 2023 04:33:07 -0500 Subject: [PATCH] fix(schemaRegistry): change api servlet check to only apply to internal to fix glue support (#8693) --- .../metadata/boot/OnBootApplicationListener.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/metadata-service/factories/src/main/java/com/linkedin/metadata/boot/OnBootApplicationListener.java b/metadata-service/factories/src/main/java/com/linkedin/metadata/boot/OnBootApplicationListener.java index 0f52bc3816..980cafacea 100644 --- a/metadata-service/factories/src/main/java/com/linkedin/metadata/boot/OnBootApplicationListener.java +++ b/metadata-service/factories/src/main/java/com/linkedin/metadata/boot/OnBootApplicationListener.java @@ -1,6 +1,7 @@ package com.linkedin.metadata.boot; import com.linkedin.gms.factory.config.ConfigurationProvider; +import com.linkedin.gms.factory.kafka.schemaregistry.InternalSchemaRegistryFactory; import java.io.IOException; import java.util.Set; import java.util.concurrent.ExecutorService; @@ -48,12 +49,17 @@ public class OnBootApplicationListener { public void onApplicationEvent(@Nonnull ContextRefreshedEvent event) { log.warn("OnBootApplicationListener context refreshed! {} event: {}", ROOT_WEB_APPLICATION_CONTEXT_ID.equals(event.getApplicationContext().getId()), event); + String schemaRegistryType = provider.getKafka().getSchemaRegistry().getType(); if (ROOT_WEB_APPLICATION_CONTEXT_ID.equals(event.getApplicationContext().getId())) { - executorService.submit(isSchemaRegistryAPIServeletReady()); + if (InternalSchemaRegistryFactory.TYPE.equals(schemaRegistryType)) { + executorService.submit(isSchemaRegistryAPIServletReady()); + } else { + _bootstrapManager.start(); + } } } - public Runnable isSchemaRegistryAPIServeletReady() { + public Runnable isSchemaRegistryAPIServletReady() { return () -> { final HttpGet request = new HttpGet(provider.getKafka().getSchemaRegistry().getUrl()); int timeouts = 30;