Skip to content

Commit

Permalink
fix(schemaRegistry): change api servlet check to only apply to intern…
Browse files Browse the repository at this point in the history
…al to fix glue support
  • Loading branch information
RyanHolstien committed Aug 22, 2023
1 parent 6559148 commit b75d7de
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit b75d7de

Please sign in to comment.