diff --git a/cameleer-server-app/src/main/java/com/cameleer/server/app/config/StorageBeanConfig.java b/cameleer-server-app/src/main/java/com/cameleer/server/app/config/StorageBeanConfig.java index 775bbc7b..57fbc9be 100644 --- a/cameleer-server-app/src/main/java/com/cameleer/server/app/config/StorageBeanConfig.java +++ b/cameleer-server-app/src/main/java/com/cameleer/server/app/config/StorageBeanConfig.java @@ -123,9 +123,14 @@ public class StorageBeanConfig { } @Bean - public SearchIndex clickHouseSearchIndex( + public ClickHouseSearchIndex clickHouseSearchIndex( TenantProperties tenantProperties, @Qualifier("clickHouseJdbcTemplate") JdbcTemplate clickHouseJdbc) { + // Return type is the concrete class so Spring exposes the bean under both + // SearchIndex (for SearchIndexer) AND ClickHouseSearchIndex (for ExchangeMatchEvaluator, + // which calls countExecutionsForAlerting — a method that exists only on the concrete type). + // Declaring the return as the interface hides the concrete methods from autowire + // matching and crashloops the app on startup. return new ClickHouseSearchIndex(tenantProperties.getId(), clickHouseJdbc); }