RICPLT-3014 Subs multiple rmr endpoints
Subscription to support multiple end points and to update routes for multiple endpoints
Change-Id: I1bb3c5fba61e878c66723a5e340aba06ac17a962
Signed-off-by: Juha Hyttinen <juha.hyttinen@nokia.com>
diff --git a/pkg/control/tracker.go b/pkg/control/tracker.go
index 11d2cf7..20af9f0 100644
--- a/pkg/control/tracker.go
+++ b/pkg/control/tracker.go
@@ -63,13 +63,15 @@
defer t.mutex.Unlock()
xappkey := TransactionXappKey{*endpoint, xid}
- if _, ok := t.transactionXappTable[xappkey]; ok {
- err := fmt.Errorf("Tracker: Similar transaction with xappkey %s is ongoing, transaction %s not created ", xappkey, trans)
+ if othtrans, ok := t.transactionXappTable[xappkey]; ok {
+ err := fmt.Errorf("Tracker: %s is ongoing, %s not created ", othtrans, trans)
return nil, err
}
trans.tracker = t
t.transactionXappTable[xappkey] = trans
+ xapp.Logger.Info("Tracker: Create %s", trans.String())
+ xapp.Logger.Debug("Tracker: transtable=%v", t.transactionXappTable)
return trans, nil
}
@@ -77,8 +79,10 @@
t.mutex.Lock()
defer t.mutex.Unlock()
if trans, ok2 := t.transactionXappTable[xappKey]; ok2 {
+ xapp.Logger.Info("Tracker: Delete %s", trans.String())
delete(t.transactionXappTable, xappKey)
+ xapp.Logger.Debug("Tracker: transtable=%v", t.transactionXappTable)
return trans, nil
}
- return nil, fmt.Errorf("Tracker: No record for xappkey %s", xappKey)
+ return nil, fmt.Errorf("Tracker: No record %s", xappKey)
}