- //
- // Subscription route updates
- //
- if epamount == 0 {
- tmpList := RmrEndpointList{}
- tmpList.AddEndpoint(trans.GetEndpoint())
- subRouteAction := SubRouteInfo{tmpList, uint16(seqId)}
- r.rtmgrClient.SubscriptionRequestDelete(subRouteAction)
- } else if subs.EpList.Size() > 0 {
- subRouteAction := SubRouteInfo{subs.EpList, uint16(seqId)}
- r.rtmgrClient.SubscriptionRequestUpdate(subRouteAction)
+ //
+ // Subscription release
+ //
+ r.mutex.Lock()
+ defer r.mutex.Unlock()
+
+ if _, ok := r.register[subId]; ok {
+ xapp.Logger.Debug("RELEASE %s", subs.String())
+ delete(r.register, subId)
+ xapp.Logger.Debug("Registry: substable=%v", r.register)
+ }
+ r.subIds = append(r.subIds, subId)
+ } else if subs.EpList.Size() > 0 {
+ //
+ // Subscription route update
+ //
+ r.RouteDeleteUpdate(subs, c)
+ }
+ }()
+
+ return nil
+}
+
+func (r *Registry) RouteDelete(subs *Subscription, trans *TransactionXapp, c *Control) {
+ tmpList := xapp.RmrEndpointList{}
+ tmpList.AddEndpoint(trans.GetEndpoint())
+ subRouteAction := SubRouteInfo{tmpList, uint16(subs.ReqId.InstanceId)}
+ if err := r.rtmgrClient.SubscriptionRequestDelete(subRouteAction); err != nil {
+ c.UpdateCounter(cRouteDeleteFail)