X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=pkg%2Fxapp%2Frmr.go;h=ef8aea5d8c50d32156c735b2126e8393bf3bdbea;hb=827a6410631045b503ce098de6683c6916c09842;hp=94070242c02ab2ab52604035f630ed1cf70e1a68;hpb=e525989b4fe86190faa820cc0a6e2f48ddb65e70;p=ric-plt%2Fxapp-frame.git diff --git a/pkg/xapp/rmr.go b/pkg/xapp/rmr.go index 9407024..ef8aea5 100755 --- a/pkg/xapp/rmr.go +++ b/pkg/xapp/rmr.go @@ -67,6 +67,7 @@ import ( "bytes" "crypto/md5" "fmt" + "github.com/spf13/viper" "strings" "time" "unsafe" @@ -169,6 +170,16 @@ func NewRMRClientWithParams(params *RMRClientParams) *RMRClient { func NewRMRClient() *RMRClient { p := GetPortData("rmr-data") + if p.Port == 0 || viper.IsSet("rmr.protPort") { + // Old xApp descriptor used, fallback to rmr section + fmt.Sscanf(viper.GetString("rmr.protPort"), "tcp:%d", &p.Port) + p.MaxSize = viper.GetInt("rmr.maxSize") + p.ThreadType = viper.GetInt("rmr.threadType") + p.LowLatency = viper.GetBool("rmr.lowLatency") + p.FastAck = viper.GetBool("rmr.fastAck") + p.MaxRetryOnFailure = viper.GetInt("rmr.maxRetryOnFailure") + } + return NewRMRClientWithParams( &RMRClientParams{ RmrData: p,