Skip to content

Commit

Permalink
feat: Add default, low prio noopSchemaStore into AutoConfiguration
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisingenhaag committed Feb 27, 2024
1 parent 83969ec commit 3b9a220
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 57 deletions.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
// Copyright 2024 Deutsche Telekom IT GmbH
//
// SPDX-License-Identifier: Apache-2.0

package de.telekom.eni.pandora.horizon.autoconfigure.schema;

import de.telekom.eni.pandora.horizon.schema.SchemaStore;
import lombok.extern.slf4j.Slf4j;
import org.everit.json.schema.Schema;
import org.springframework.boot.autoconfigure.AutoConfigureOrder;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.Ordered;

@Configuration
@Slf4j
public class SchemaStoreConfiguration {

@ConditionalOnMissingBean({SchemaStore.class})
@AutoConfigureOrder(Ordered.LOWEST_PRECEDENCE)
@Bean
public SchemaStore noOpSchemaStore() {
return new SchemaStore() {
@Override
public Schema getSchemaForEventType(String environment, String eventType, String hub, String team) {
log.debug("SchemaCacheService is not implemented, returning null");
return null;
}

@Override
public void pollSchemas() {
log.debug("SchemaCacheService is not implemented");
}
};
}

}
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
de.telekom.eni.pandora.horizon.autoconfigure.HorizonAutoConfiguration
de.telekom.eni.pandora.horizon.autoconfigure.KubernetesClientConfiguration
de.telekom.eni.pandora.horizon.autoconfigure.cache.SchemaCacheAutoConfiguration
de.telekom.eni.pandora.horizon.autoconfigure.schema.SchemaStoreConfiguration

0 comments on commit 3b9a220

Please sign in to comment.