Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

backend: check for connect clusters in new connect service startup to… #1122

Merged
merged 3 commits into from
Feb 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions backend/pkg/connect/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,20 @@ type ClientWithConfig struct {
// NewService creates a new connect.Service. It tests the connectivity for each configured
// Kafka connect cluster proactively.
func NewService(cfg config.Connect, logger *zap.Logger) (*Service, error) {
logger.Info("creating Kafka connect HTTP clients and testing connectivity to all clusters")
clientsByCluster := make(map[string]*ClientWithConfig)

if len(cfg.Clusters) == 0 {
return &Service{
Cfg: cfg,
Logger: logger,
ClientsByCluster: clientsByCluster,
Interceptor: interceptor.NewInterceptor(),
}, nil
}

// 1. Create a client for each configured Connect cluster
clientsByCluster := make(map[string]*ClientWithConfig)
logger.Info("creating Kafka connect HTTP clients and testing connectivity to all clusters")

for _, clusterCfg := range cfg.Clusters {
// Create dedicated Connect HTTP Client for each cluster
childLogger := logger.With(
Expand Down
Loading