SEBA-949 support for publishing bbsim events on kafka
Change-Id: I4354cd026bbadc801e4d6d08b2f9cd3462917b4c
diff --git a/cmd/bbr/bbr.go b/cmd/bbr/bbr.go
index 9e1ebc5..52ae622 100644
--- a/cmd/bbr/bbr.go
+++ b/cmd/bbr/bbr.go
@@ -81,6 +81,7 @@
0, // this parameter does not matter in the BBR case
options.BBSim.ControlledActivation,
false, // this parameter is not important in the BBR Case
+ false,
true,
)
diff --git a/cmd/bbsim/bbsim.go b/cmd/bbsim/bbsim.go
index 275ec34..2de8906 100644
--- a/cmd/bbsim/bbsim.go
+++ b/cmd/bbsim/bbsim.go
@@ -154,6 +154,7 @@
"EnableAuth": options.BBSim.EnableAuth,
"Dhcp": options.BBSim.EnableDhcp,
"Delay": options.BBSim.Delay,
+ "Events": options.BBSim.Events,
"ControlledActivation": options.BBSim.ControlledActivation,
"EnablePerf": options.BBSim.EnablePerf,
}).Info("BroadBand Simulator is on")
@@ -173,6 +174,7 @@
options.BBSim.Delay,
options.BBSim.ControlledActivation,
options.BBSim.EnablePerf,
+ options.BBSim.Events,
false,
)
@@ -198,6 +200,16 @@
go sadis.StartRestServer(olt, &wg)
}
+ if options.BBSim.Events {
+ // initialize a publisher
+ if err := common.InitializePublisher(olt.ID); err == nil {
+ // start a go routine which will read from channel and publish on kafka
+ go common.KafkaPublisher(olt.EventChannel)
+ } else {
+ log.Errorf("Failed to start kafka publisher: %v", err)
+ }
+ }
+
wg.Wait()
defer func() {