# Does confD support to unsubscribe and subscribed keypath?

**URL:** <https://dmap-community.ductus.global/t/does-confd-support-to-unsubscribe-and-subscribed-keypath/1138>\
**Category:** CDB and CDB API\
**Created:** [April 5, 2017, 1:42pm UTC](https://dmap-community.ductus.global/t/does-confd-support-to-unsubscribe-and-subscribed-keypath/1138 "2017-04-05T13:42:10Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![sudhanshu](https://avatars.discourse-cdn.com/v4/letter/s/6bbea6/32.png) [@sudhanshu](https://dmap-community.ductus.global/u/sudhanshu)\
**Post date:** [April 5, 2017, 1:42pm UTC](https://dmap-community.ductus.global/t/does-confd-support-to-unsubscribe-and-subscribed-keypath/1138/1 "2017-04-05T13:42:11Z")

</div>

Does confD support to unsubscribe and subscribed keypath ?

---

<div class="post-metadata">

**Author:** ![mnovak](https://yyz2.discourse-cdn.com/flex010/user_avatar/dmap-community.ductus.global/mnovak/32/183_2.png) [@mnovak](https://dmap-community.ductus.global/u/mnovak)\
**Post date:** [April 6, 2017, 9:05am UTC](https://dmap-community.ductus.global/t/does-confd-support-to-unsubscribe-and-subscribed-keypath/1138/2 "2017-04-06T09:05:35Z")

</div>

No. The easiest way is to ignore given subscription point and not request `modifications` or `diff` for it.

---

<div class="post-metadata">

**Author:** ![sudhanshu](https://avatars.discourse-cdn.com/v4/letter/s/6bbea6/32.png) [@sudhanshu](https://dmap-community.ductus.global/u/sudhanshu)\
**Post date:** [April 6, 2017, 11:52am UTC](https://dmap-community.ductus.global/t/does-confd-support-to-unsubscribe-and-subscribed-keypath/1138/3 "2017-04-06T11:52:12Z")

</div>

thanks.

What about re-subscription ? now suppose i have done subscription for 10 node. and dynamically i want to add more subscription at run time then how to do that. As we know that once cdb\_subscription\_done is called  
we can not call cdb\_subscribe2 again on same subscription socket.

---

<div class="post-metadata">

**Author:** ![cohult](https://yyz2.discourse-cdn.com/flex010/user_avatar/dmap-community.ductus.global/cohult/32/221_2.png) [@cohult](https://dmap-community.ductus.global/u/cohult)\
**Post date:** [April 6, 2017, 12:10pm UTC](https://dmap-community.ductus.global/t/does-confd-support-to-unsubscribe-and-subscribed-keypath/1138/4 "2017-04-06T12:10:08Z")

</div>

Close and re-open the subscription socket.

Pseudo code example:

```auto
  close(subsock);
  // Do something
  subsock = socket(PF_INET, SOCK_STREAM, 0);
  cdb_connect(subsock, CDB_SUBSCRIPTION_SOCKET, (struct sockaddr*)&addr, sizeof (struct sockaddr_in));
  cdb_subscribe(subsock, 1, my__ns, &mysubpoint, "/my/path");
  cdb_subscribe_done(subsock);

```

---

<div class="post-metadata">

**Author:** ![sudhanshu](https://avatars.discourse-cdn.com/v4/letter/s/6bbea6/32.png) [@sudhanshu](https://dmap-community.ductus.global/u/sudhanshu)\
**Post date:** [April 6, 2017, 12:34pm UTC](https://dmap-community.ductus.global/t/does-confd-support-to-unsubscribe-and-subscribed-keypath/1138/5 "2017-04-06T12:34:28Z")

</div>

Yes. That can be done.  
I was looking for modify subscription list kind of functionality. where suppose i have subscribed 5 nodes  
now at run time due to some scalability i may need to reduce few subscription or need to add few more subscription without closing current subscription socket redoing subscription for already added subscription.

From my study it dont seem possible and we have only way to do as you mentioned.  
is it limitation of confD basic and may be available in confD premium ?

---

<div class="post-metadata">

**Author:** ![cohult](https://yyz2.discourse-cdn.com/flex010/user_avatar/dmap-community.ductus.global/cohult/32/221_2.png) [@cohult](https://dmap-community.ductus.global/u/cohult)\
**Post date:** [May 22, 2017, 10:39am UTC](https://dmap-community.ductus.global/t/does-confd-support-to-unsubscribe-and-subscribed-keypath/1138/6 "2017-05-22T10:39:00Z")

</div>

Hi,  
You can for example do something like open up a new subscription socket with the remaining+new subscriptions and close the old socket when the new one is up.
