From af9ded8e05c803395d6dfb615e7fc42304283eab Mon Sep 17 00:00:00 2001 From: vijeyash Date: Sat, 29 Jul 2023 13:58:09 +0530 Subject: [PATCH] testing --- client/pkg/clients/bridge_client.go | 3 ++- client/pkg/clients/clients.go | 20 ++++++++++---------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/client/pkg/clients/bridge_client.go b/client/pkg/clients/bridge_client.go index b7596930..400eb0d5 100644 --- a/client/pkg/clients/bridge_client.go +++ b/client/pkg/clients/bridge_client.go @@ -29,12 +29,13 @@ type GitNats string const ( bridgeSubjects GitNats = "GITMETRICS.*" bridgeSubject GitNats = "GITMETRICS.git" - bridgeConsumer GitNats = "GIT_CONSUMER" + bridgeConsumer GitNats = "Git-Consumer" ) // SubscribeGitBridgeNats subscribes to nats jetstream and calls // the respective funcs to insert data into clickhouse DB func (n *NATSContext) SubscribeGitBridgeNats(conn clickhouse.DBInterface) { + log.Printf("Creating nats consumer %s with subject: %s \n", bridgeConsumer, bridgeSubject) n.stream.Subscribe(string(bridgeSubject), func(msg *nats.Msg) { msg.Ack() gitprovider := msg.Header.Get("GitProvider") diff --git a/client/pkg/clients/clients.go b/client/pkg/clients/clients.go index 0ac4fef2..5e337ff4 100644 --- a/client/pkg/clients/clients.go +++ b/client/pkg/clients/clients.go @@ -46,16 +46,16 @@ func NewNATSContext(conf *config.Config, dbClient clickhouse.DBInterface) (*NATS } ctx.SubscribeGitBridgeNats(dbClient) - _, err = stream.StreamInfo("CONTAINERMETRICS") - if err != nil { - return nil, fmt.Errorf("container metrics stream not found %w", err) - } - ctx.SubscribeContainerNats(dbClient) - _, err = stream.StreamInfo("METRICS") - if err != nil { - return nil, fmt.Errorf("kubeviz metrics stream not found %w", err) - } - ctx.SubscribeAllKubvizNats(dbClient) + // _, err = stream.StreamInfo("CONTAINERMETRICS") + // if err != nil { + // return nil, fmt.Errorf("container metrics stream not found %w", err) + // } + // ctx.SubscribeContainerNats(dbClient) + // _, err = stream.StreamInfo("METRICS") + // if err != nil { + // return nil, fmt.Errorf("kubeviz metrics stream not found %w", err) + // } + // ctx.SubscribeAllKubvizNats(dbClient) return ctx, nil }