fix(schemaRegistry): change api servlet check to only apply to internal to fix glue support (#8693)

This commit is contained in:
RyanHolstien 2023-08-28 04:33:07 -05:00 committed by GitHub
parent 47571e6257
commit 9c5ab1bcd3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;