Skip to content

Commit

Permalink
Merge pull request #121 from vijeyash1/testing
Browse files Browse the repository at this point in the history
testing
  • Loading branch information
jebinjeb authored Jul 29, 2023
2 parents a335b83 + af9ded8 commit 7b770e6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
3 changes: 2 additions & 1 deletion client/pkg/clients/bridge_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
20 changes: 10 additions & 10 deletions client/pkg/clients/clients.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 7b770e6

Please sign in to comment.