orleans icon indicating copy to clipboard operation
orleans copied to clipboard

The question of using AddMemoryGrainStorage ("PubSubStore") when subscribing to StreamProvider on the client side

Open HermesNew opened this issue 7 years ago • 2 comments

The client needs to subscribe to the StreamProvider to get the message pushed by the Silo side. Because of the need for PubSubStore, AddMemoryGrainStorage ("PubSubStore") is used. Because you need to ensure that the client can get the push message, you can't cancel the subscription, but this will cause a serious problem. When I generate Guid different, PubSubRendezvousGrain generates a lot of data. How to clear up old subscription data? If the client restarts, will the old data of the PubSubRendezvousGrain in the silo be clear?

HermesNew avatar Apr 02 '19 08:04 HermesNew

How to clear up old subscription data?

By using IStreamSubscriptionManager, you can manually remove old subscriptions, if you know its information. Sample code below: this.subManager = serviceProvider.GetService<IStreamSubscriptionManagerAdmin>().GetStreamSubscriptionManager(StreamSubscriptionManagerType.ExplicitSubscribeOnly); this.subManager.RemoveSubscription(streamProdividerName, streamId, subscriptionId);

If the client restarts, will the old data of the PubSubRendezvousGrain in the silo be clear?

The old data won't be cleared because client restarts, but it might if the silo restarts if you use MemoryGrainStorage, try use an external storage such as Azure should be better for prod environment.

xiazen avatar May 08 '19 18:05 xiazen

ok,thanks.

HermesNew avatar May 10 '19 07:05 HermesNew