fix(alerting): ClickHouseSearchIndex bean registered as concrete type (hotfix: production crashloop) #141

Merged
hsiegeln merged 1 commits from fix/alerting-searchindex-bean-type into main 2026-04-20 10:24:50 +02:00

View File

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