Add NodeId and JobId as configuration in ICS Version
[nonrtric/rapp/ransliceassurance.git] / icsversion / main.go
index b9e9afc..eeff5b4 100644 (file)
@@ -34,8 +34,6 @@ import (
 var configuration *config.Configuration
 var a sliceassurance.App
 
-const TOPIC string = "/events/unauthenticated.VES_O_RAN_SC_HELLO_WORLD_PM_STREAMING_OUTPUT/myG/C1"
-
 func main() {
        configuration = config.New()
 
@@ -51,13 +49,18 @@ func main() {
        a = sliceassurance.App{}
        a.Initialize(configuration)
 
-       go a.StartServer()
+       go func() {
+               a.StartServer()
+               os.Exit(1) // If the startServer function exits, it is because there has been a failure in the server, so we exit.
+       }()
        keepConsumerAlive()
 }
 
 func validateConfiguration(configuration *config.Configuration) error {
        if configuration.ConsumerHost == "" || configuration.ConsumerPort == 0 {
                return fmt.Errorf("consumer host and port must be provided")
+       } else if configuration.NodeId == "" {
+               return fmt.Errorf("NodeId must be provided")
        }
        return nil
 }