|
@@ -9,6 +9,7 @@ import (
|
|
ccfg "git.wecise.com/wecise/common/matrix/cfg"
|
|
ccfg "git.wecise.com/wecise/common/matrix/cfg"
|
|
clog "git.wecise.com/wecise/common/matrix/logger"
|
|
clog "git.wecise.com/wecise/common/matrix/logger"
|
|
"git.wecise.com/wecise/odb-go/odb"
|
|
"git.wecise.com/wecise/odb-go/odb"
|
|
|
|
+ "git.wecise.com/wecise/odb-go/odb/eventmsg"
|
|
"github.com/scylladb/go-set/strset"
|
|
"github.com/scylladb/go-set/strset"
|
|
)
|
|
)
|
|
|
|
|
|
@@ -23,7 +24,7 @@ func init() {
|
|
var odbcfg *odb.Config
|
|
var odbcfg *odb.Config
|
|
|
|
|
|
func init() {
|
|
func init() {
|
|
- odbpath := cfg.GetStrings("ODBPATH", "127.0.0.1:11001")
|
|
|
|
|
|
+ odbpath := cfg.GetStrings("ODBPATH", "127.0.0.1:11001,47.92.151.165:11001")
|
|
keyspace := cfg.GetString("KEYSPACE", "oktest")
|
|
keyspace := cfg.GetString("KEYSPACE", "oktest")
|
|
poolsize := cfg.GetInt("POOLSIZE", 0)
|
|
poolsize := cfg.GetInt("POOLSIZE", 0)
|
|
|
|
|
|
@@ -65,7 +66,11 @@ func Subscribe(client odb.Client, topic string) {
|
|
}
|
|
}
|
|
}()
|
|
}()
|
|
for m := range sub.Channel() {
|
|
for m := range sub.Channel() {
|
|
- log.Info(topic + " received " + m.Payload)
|
|
|
|
|
|
+ oem, err := eventmsg.FromMsgpack([]byte(m.Payload))
|
|
|
|
+ if err != nil {
|
|
|
|
+ log.Error(err)
|
|
|
|
+ }
|
|
|
|
+ log.Info(topic + " received " + m.Payload + "\n" + oem.YamlString())
|
|
}
|
|
}
|
|
}()
|
|
}()
|
|
}
|
|
}
|