kdcllc / CometD.NetCore

CometD for use with Salesforce Platform Events
MIT License
28 stars 16 forks source link

Listener Unsubscribes from the Channel after 24 hours #8

Closed jacksondaw closed 4 years ago

jacksondaw commented 4 years ago

First off, thank you for the great library! There are many CometD NuGets, but this is the only one I was able to find that supports the concept of "Replays" and is also dotnet core.

While testing this library I ran across an interesting behavior where there would be a loss of receiving events if there were no Platform Events added within a 24 hour period. I have a hypothesis that this is caused by chain reaction where this client is forced to reconnect to the channel. During this re-connection process the Bayeux client unsubscribes, but fails to resubscribe.

Here is where the ResetSubscription is called: https://github.com/kdcllc/CometD.NetCore/blob/745dffac68d42849e2e929a301ce33e8bc663882/src/CometD.NetCore/Common/AbstractSessionChannel.cs#L163

I was wondering if one of the original authors can shed light on how the ResetSubscription process is supposed to work?

kdcllc commented 4 years ago

@jacksondaw I believe you refer to the Salesforce communication issue. It closes the connections after an arbitrary period. Checkout an implementation of this library as a message bus here https://github.com/kdcllc/Bet.BuildingBlocks.SalesforceEventBus/tree/master/src/Bet.Salesforce.TestApp Let me know if this works for your needs.

jacksondaw commented 4 years ago

Aye, that looks like it will handle the situation. I'll give it a try on my app.

Thanks for pointing me in the right direction!