Cleanup Subscriptions on unsub
mmmries opened this issue · comments
Michael commented
When a client calls sub
we record a mapping entry to map their sid
to the receivers address (ie where we will deliver the messages). When a client calls unsub
, we should remove this mapping. Also if a client calls unsub
with max_messages: 1
, we should automatically cleanup the mapping of sid
=> pid
.
In the request
/response
flow we generate a new subscription for every request and failure to cleanup these subscriptions will result in a memory leak.