Hi Anand,
I have not yet had a chance to test this properly, but have looked through the code sample.
Could you please try calling Close() on the subscription when it is dropped and see if that helps any? The connection code currently doesn’t do this.
For example:
var result = await _connection.ConnectToPersistentSubscriptionAsync(
streamName,
groupName,
(subscription, resolved) => Task.Run(() => OnEventAppearedPersistentStream(subscription, GetSubscriptionKey(streamName, groupName), resolved, false)),
(subscription, dropReason, exception) =>
{
subscription**.Stop(timeout);**
Task.Run(() => OnSubscriptionDropped(streamName, groupName, dropReason, exception));
},
null,
Environment.ProcessorCount,
false);
``
Also, how often is your connection to the persistent subscription being dropped and reconnected?
If there are any, what causes the subscription connections to be dropped?