[VOL-2961] Added configuration for kafka topic
Change-Id: I4dd609774938e775e00d7a0ed36177fa5f9ff8a2
diff --git a/internal/common/options.go b/internal/common/options.go
index 6088a1d..0ecb0c8 100644
--- a/internal/common/options.go
+++ b/internal/common/options.go
@@ -20,11 +20,12 @@
"errors"
"flag"
"fmt"
- "github.com/ghodss/yaml"
"io/ioutil"
- log "github.com/sirupsen/logrus"
"net"
"strings"
+
+ "github.com/ghodss/yaml"
+ log "github.com/sirupsen/logrus"
)
var tagAllocationValues = []string{
@@ -57,7 +58,6 @@
TagAllocationUnique
)
-
var sadisFormatValues = []string{
"unknown",
"att",
@@ -143,6 +143,7 @@
Events bool `yaml:"enable_events"`
ControlledActivation string `yaml:"controlled_activation"`
EnablePerf bool `yaml:"enable_perf"`
+ KafkaEventTopic string `yaml:"kafka_event_topic`
}
type BBRConfig struct {
@@ -183,6 +184,7 @@
Events: false,
ControlledActivation: "default",
EnablePerf: false,
+ KafkaEventTopic: "",
},
OltConfig{
Vendor: "BBSim",
@@ -261,6 +263,7 @@
enablePerf := flag.Bool("enableperf", conf.BBSim.EnablePerf, "Setting this flag will cause BBSim to not store data like traffic schedulers, flows of ONUs etc..")
enableEvents := flag.Bool("enableEvents", conf.BBSim.Events, "Enable sending BBSim events on configured kafka server")
kafkaAddress := flag.String("kafkaAddress", conf.BBSim.KafkaAddress, "IP:Port for kafka")
+ kafkaEventTopic := flag.String("kafkaEventTopic", conf.BBSim.KafkaEventTopic, "Ability to configure the topic on which BBSim publishes events on Kafka")
flag.Parse()
sTagAlloc, err := tagAllocationFromString(*s_tag_allocation)
@@ -304,6 +307,7 @@
conf.BBSim.ApiAddress = *api_address
conf.BBSim.RestApiAddress = *rest_api_address
conf.BBSim.SadisFormat = sf
+ conf.BBSim.KafkaEventTopic = *kafkaEventTopic
// update device id if not set
if conf.Olt.DeviceId == "" {