🚀 Integrate Hasura service into NATS message processing.
This commit is contained in:
+6
-2
@@ -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
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user