Merge pull request 'fix(alerting): ClickHouseSearchIndex bean registered as concrete type (hotfix: production crashloop)' (#141) from fix/alerting-searchindex-bean-type into main
All checks were successful
CI / cleanup-branch (push) Has been skipped
CI / build (push) Successful in 1m53s
CI / docker (push) Successful in 31s
CI / deploy-feature (push) Has been skipped
CI / deploy (push) Successful in 42s

Reviewed-on: #141
This commit was merged in pull request #141.
This commit is contained in:
2026-04-20 10:24:49 +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);
}