Orleans Streams Extensibility: Writing a Custom Queue Adapter for 2.0
Team, Please guide me how to implement custom stream provider.
Below documentation doesn't seems to be correct for Orleans 2.0. https://dotnet.github.io/orleans/Documentation/Orleans-Streams/Streams-Extensibility.html
Step 4: as per above link
4. Declare public class MyQueueStreamProvider : PersistentStreamProvider
Thanks
below is an example on how to configure silo with custom stream provider, where MyQueueStreamProviderAdapterFactory is the custom IQueueAdapterFactory
hostBuilder
.AddPersistentStreams(StreamProviderName, MyQueueStreamProviderAdapterFactory .Create, b=>b
.ConfigureComponent<IStreamQueueCheckpointerFactory>((s, n) => NoOpCheckpointerFactory.Instance)
.Configure<StreamStatisticOptions>(ob => ob.Configure(options => options.StatisticMonitorWriteInterval = monitorWriteInterval))
.UseDynamicClusterConfigDeploymentBalancer());
As for https://dotnet.github.io/orleans/Documentation/Orleans-Streams/Streams-Extensibility.html. The configuration step probably should be updated, since we don't support configure through XML natively anymore, you need to use IOptions and IConfiguration for that. And step 4 shouldn't be needed anymore, since now the streaming configuration is more componentized. So to configure a custom stream provider, one need to inject the custom QueueAdapterFactory through ISiloPersistentStreamConfigurator or IClusterClientPersistentStreamConfigurator, which eventually feed into DI, compared before it was configured through inheritance.
Thanks for point it out. I will update the docs
Thanks. That works!
Resolved by #10591, which adds the current custom persistent-stream queue adapter guide and compiling example.