🚀 Integrate Hasura service into NATS message processing.

This commit is contained in:
windyboy
2024-08-14 11:48:39 +08:00
parent a5fa4955f4
commit da1d713946
+6 -2
View File
@@ -3,6 +3,7 @@ package main
import ( import (
"caatsm/internal/config" "caatsm/internal/config"
"caatsm/internal/nats" "caatsm/internal/nats"
"caatsm/internal/repository"
"caatsm/pkg/utils" "caatsm/pkg/utils"
"os" "os"
@@ -82,7 +83,10 @@ func executeListen(c *cli.Context) error {
fmt.Println("Loaded configuration successfully") fmt.Println("Loaded configuration successfully")
log := utils.GetLogger() log := utils.GetLogger()
log.Info("Starting nats subscriber") log.Info("Starting nats subscriber")
// handler := handlers.New(cfg) publisher := nats.NewPub(cfg)
nats.Subscribe(cfg) repository := repository.NewHasura(cfg)
handler := nats.NewHandler(cfg, publisher, repository)
subscriber := nats.NewSub(cfg)
subscriber.Subscribe(cfg, handler)
return nil return nil
} }