+ clientUrl := fmt.Sprintf("http://%s:%d%s", ep.Host, *ep.HTTPPort, r.clientUrl)
+
+ retries := viper.GetInt("subscription.retryCount")
+ if retries == 0 {
+ retries = 10
+ }
+
+ delay := viper.GetInt("subscription.retryDelay")
+ if delay == 0 {
+ delay = 5
+ }
+
+ for i := 0; i < retries; i++ {
+ r, err := http.Post(clientUrl, "application/json", bytes.NewBuffer(respData))
+ if err == nil && (r != nil && r.StatusCode == http.StatusOK) {
+ break
+ }
+
+ if err != nil {
+ Logger.Error("%v", err)
+ }
+ if r != nil && r.StatusCode != http.StatusOK {
+ Logger.Error("clientUrl=%s statusCode=%d", clientUrl, r.StatusCode)
+ }
+ time.Sleep(time.Duration(delay) * time.Second)
+ }
+
+ return err
+}
+
+// Subscription interface for xApp: Response callback
+func (r *Subscriber) SetResponseCB(c SubscriptionResponseCallback) {
+ r.clientCB = c