+func (e *ExampleXapp) Consume(msg *xapp.RMRParams) (err error) {
+ id := xapp.Rmr.GetRicMessageName(msg.Mtype)
+
+ xapp.Logger.Info("Message received: name=%s meid=%s subId=%d txid=%s len=%d", id, msg.Meid.RanName, msg.SubId, msg.Xid, msg.PayloadLen)
+
+ switch id {
+ case "RIC_INDICATION":
+ e.handleRICIndication(msg.Meid.RanName, msg)
+ case "RIC_EXAMPLE_MESSAGE":
+ e.handleRICExampleMessage(msg.Meid.RanName, msg)
+ default:
+ xapp.Logger.Info("Unknown Message Type '%d', discarding", msg.Mtype)
+ }
+
+ defer func() {
+ xapp.Rmr.Free(msg.Mbuf)
+ msg.Mbuf = nil
+ }()