Added new implementation for the following feature requests:
[ric-plt/xapp-frame.git] / test / xapp / forwarder.go
index 88a99a0..63ec16f 100755 (executable)
@@ -7,27 +7,27 @@ import (
 type Forwarder struct {
 }
 
-func (m Forwarder) Consume(mtype, subId int, payload []byte, meid *xapp.RMRMeid) (err error) {
-       xapp.Logger.Debug("Message received - type=%d subId=%d meid=%v", mtype, subId, meid)
+func (m Forwarder) Consume(params *xapp.RMRParams) (err error) {
+       xapp.Logger.Debug("Message received - type=%d subId=%d meid=%v xid=%v", params.Mtype, params.SubId, params.Meid, params.Xid)
 
        // Store data and reply with the same message payload
        if xapp.Config.GetInt("test.store") != 0 {
-               xapp.Sdl.Store("myKey", payload)
+               xapp.Sdl.Store("myKey", params.Payload)
        }
 
        mid := xapp.Config.GetInt("test.mtype")
        if mid != 0 {
-               mtype = mid
+               params.Mtype = mid
        } else {
-               mtype = mtype + 1
+               params.Mtype = params.Mtype + 1
        }
 
        sid := xapp.Config.GetInt("test.subId")
        if sid != 0 {
-               subId = sid
+               params.SubId = sid
        }
 
-       if ok := xapp.Rmr.Send(mtype, subId, payload, nil); !ok {
+       if ok := xapp.Rmr.SendMsg(params); !ok {
                xapp.Logger.Info("Rmr.Send failed ...")
        }
        return